An open API service indexing awesome lists of open source software.

https://github.com/yenilikci/ts-rest-api

Node.js REST API with Express.js, Mongoose & TypeScript
https://github.com/yenilikci/ts-rest-api

bcrypt best-practices dayjs expressjs jwt lodash mongoose nanoid pino typescript zod

Last synced: 4 months ago
JSON representation

Node.js REST API with Express.js, Mongoose & TypeScript

Awesome Lists containing this project

README

          

# ts-rest-api

## dependencies

✨ bcrypt

✨ config

✨ cors

✨ dayjs

✨ express

✨ jsonwebtoken

✨ lodash

✨ mongoose

✨ nanoid

✨ pino

✨ pino-pretty

✨ zod

## endpoints

| Endpoint | Http Request Method | Body | Params | Args | Description |
| ------------ | ------------ | ------------ | ------------ | ------------ | ------------ |
| /api/users | POST | {"email": "example@mail.com", "password": "M12345.", "passwordConfirmation": "M12345.", "name": "melihcelik"} | Empty | Empty | It allows us to register the user. |
| /api/sessions | POST | {"email": "example@mail.com", "password": "M12345."} | Empty | Empty | Allows us to log in. Returns tokens. |
| /api/sessions | GET | Empty | Empty | Empty | Get session list. |
| /api/sessions | DELETE | Empty | Empty | Empty | Terminates sessions by updating the session list. |
| /api/products | POST | { "title": "Product 1", "description": "Amazing product", "price": 99.99, "image": "comlaf.com/images/1" } | Empty | Empty | Creates a new product. |
| /api/products | PUT | { "title": "Product 1", "description": "Updated amazing product ", "price": 98.99, "image": "comlaf.com/images/1" } | productId:ObjectId | Empty | Update product by id. |
| /api/products | GET | Empty | productId:ObjectId | Empty | Get product by id. |
| /api/products | DELETE | Empty | productId:ObjectId | Empty | Delete product by id. |