A simple REST API capable of CRUD operations on a "person" resource that interfaces with a MongoDB database.
Route | Description |
---|---|
GET /api/:userId |
Fetch a user from the database |
POST /api |
Create a new user |
PUT /api/:userId |
Update a user |
DELETE /api/:userId |
Delete a user |
clone project repository:
git clone https://github.com/nicholasikiroma/crudApp.git
cd crudApp
Install dependencies:
npm install
Create a .env
with the values:
DATABASE_URL=<replace-with-mongodb-connection-string>
Start up server:
npm run start
The API will be available at http://localhost:PORT/api