Copy the following command, and execute it in your terminal.
$ npm install -g generate-express-api
$ generate-api .
The above command will generate an Express + Node.js + MongoDB API boilerplate in the current working directory.
$ generate-api <dirname>
The above command will generate an Express + Node.js + MongoDB API boilerplate in a new directory called .
After the boilderplate is generated, cd into the directory, and run npm install
$ cd <dirname>
$ npm install
After the installation is complete, you can run the server by using the following command.
$ npm start
If the environment variables are set, and a port is designated, the server will start at the designated port, else it will start at port 8000.
Initially, API for Login and signup functionalities is readily available.
Description Registers a user with the given details
Request type POST
Header body { fname, lname, email, username, password }
Response A status code, and a response message.
Description Checks if the username is already used.
Request type POST
Header body { username }
Response A status code, and a response message.
Description Checks if the email is already used.
Request type POST
Header body { email }
Response A status code, and a response message.
Description Logs in a user with the given details.
Request type POST
Header body { username, password }
Response A status code, a response message and a JWT token.