A simple REST API built with Node.js using the Express framework, TypeScript, and MongoDB.
- Open project file
- npm install
- Prepare .env file and include settings:
ENV |
---|
PORT="YOUR_PORT" |
MONGO_URL="YOUR_URL" |
SECRET="YOUR_SECRET" |
- npm run start
Method | Rout | Description |
---|---|---|
POST | /auth/register | Register a new user. |
POST | /auth/login | Login user after register. |
GET | /users | Fetches a list of all users. |
GET | /users/:id | Fetches information about a user with a specific ID. |
POST | /users | Adds a new user. |
PUT | /users/:id | Updates information about a user with a specific ID. |
DELETE | /users/:id | Deletes a user with a specific ID. |
Node.js Express TypeScript MongoDB