Skip to content

nwnordahl/express-rest-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Express rest api

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/.

TODO

  • Integrate with a database
  • Extend with more HTTP methods
  • Hook it up with a front end

Requirements

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).

How to set up (locally)

  1. Clone this repository:
$ git clone https://github.com/nwnordahl/express-rest-api
  1. Install the required packages in the cloned repository with npm:
$ npm i
  1. Run server:
$ npm run dev

If you see 'Server running on port 5000' in the terminal you are good to go!

How to use

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.