A node rest api using express. An identical api using only vanilla node can be found here. The api is deployed to the cloud with Heroku, and the routes can be accessed with the base url https://express-rest-api-4.herokuapp.com/
.
- Integrate with a database
- Extend with more HTTP methods
- Hook it up with a front end
Git, node and npm (Node Version Manager is recommended for installing node and npm on macOS and Linux. A similar manager is provided for Windows).
- Clone this repository:
$ git clone https://github.com/nwnordahl/express-rest-api
- Install the required packages in the cloned repository with npm:
$ npm i
- Run server:
$ npm run dev
If you see 'Server running on port 5000' in the terminal you are good to go!
If you want to use it locally, make sure that you have done the steps above. Simple GET requests can be done right in the web browser. More advanced communication (POST, PUT, DELETE, etc.) with the api can be done with software like Postman and Isomnia, or with the Rest Client extension in VSCode using the requests.http
file.