Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shashankbiet/nodejs-clean-architecture-api
NodeJS API build on Clean Architecture
https://github.com/shashankbiet/nodejs-clean-architecture-api
docker express javascript mongodb nodejs unit-test
Last synced: about 1 month ago
JSON representation
NodeJS API build on Clean Architecture
- Host: GitHub
- URL: https://github.com/shashankbiet/nodejs-clean-architecture-api
- Owner: shashankbiet
- License: mit
- Created: 2020-05-25T04:44:50.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-12-20T18:01:39.000Z (about 1 year ago)
- Last Synced: 2024-02-02T20:42:12.325Z (11 months ago)
- Topics: docker, express, javascript, mongodb, nodejs, unit-test
- Language: JavaScript
- Homepage:
- Size: 140 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nodejs-clean-architecture-api
NodeJS API build on Clean Architecture using express framework and mongodb.
## Run in docker
Make sure you have docker installed. At the root folder run the following command:
```bash
docker-compose up -d
```## Run Locally
Clone the project
```bash
git clone https://github.com/shashankbiet/nodejs-clean-architecture-api
```Go to the project directory
```bash
cd nodejs-clean-architecture-api
```Install dependencies
```bash
npm i
```Start the server
```bash
npm run dev
```## Running Tests
To run tests, run the following command
```bash
npm run test
```## API Reference
#### Get all students
```http
GET /api/student
```#### Get student by id
```http
GET /api/student/${_id}
```#### Create student
```http
POST /api/student
``````bash
{
"id": 101,
"name": "John",
"gender":"male",
"email":"[email protected]",
"mobileNo":1234567890
}
```#### Update student by id
```http
PUT /api/student/${_id}
``````bash
{
"id": 101,
"name": "Johnny",
"gender":"male",
"email":"[email protected]",
"mobileNo":2224567890
}
```#### Delete student by id
```http
DELETE /api/student/${_id}
```