|
1 | 1 | # Gamerbot-REST-API |
2 | 2 |
|
3 | | -This is going to be a layer between SGC applications and the database to streamline the process and use fewer connections to the database. |
| 3 | +This is SGC API. The API is mostly used with SGC:s Discord bot "Gamerbot", but is planed in the future to be used on the website too. |
4 | 4 |
|
5 | 5 | # Public routes |
6 | 6 |
|
7 | 7 | Here is a wiki on how to use them |
8 | 8 |
|
9 | 9 | https://github.com/onlinesgc/Gamerbot-REST-API/wiki |
10 | 10 |
|
11 | | -# Setup developer environment |
| 11 | +# Setup dev environment |
12 | 12 |
|
13 | | -1. First, clone this project: `git clone https://github.com/stamdiscord/Gamerbot-REST-API.git` |
14 | | -2. Make sure you have Node.js and npm (or any other package installer) installed on your computer. |
15 | | -3. Then, navigate to the project directory and run `npm install`. This will install all the required packages. |
16 | | -4. To run the server in development mode, use the command `npm run dev`. |
| 13 | +### Prerequisite to run the API |
| 14 | + |
| 15 | +- [NodeJS](https://nodejs.org/en). |
| 16 | +- A package manager. I use [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) |
| 17 | +- A Mongodb cluster. (Instructions below) |
| 18 | + 1. Make an account on [MongoDB](https://www.mongodb.com/developer/) |
| 19 | + 2. Create an new project |
| 20 | + 3. Create an new cluster in the project |
| 21 | + 4. It will ask you to create an login, do it and save down the password and username |
| 22 | + 5. When they ask you were you are going to use cluster, press node.js. |
| 23 | + 6. You will now see a string that looks somting like this `mongodb+srv://<Username>:<password>@<clustername>....`. Save this link |
| 24 | + |
| 25 | +### Setup |
| 26 | + |
| 27 | +1. First clone the project `git clone https://github.com/onlinesgc/Gamerbot-REST-API.git` |
| 28 | +2. Go into the directory and run `npm run install` |
| 29 | +3. You want copy and rename the `.env.example` file to `.env` |
| 30 | +4. Edit the `.env` file and add the MongoDB url |
| 31 | +5. Now you can run the project. You can do this by running `npm run dev`. |
0 commit comments