Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRUD API #1

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open

CRUD API #1

wants to merge 20 commits into from

Conversation

Ihar-dev
Copy link
Owner

@Ihar-dev Ihar-dev commented Jun 15, 2022

  1. Task: https://github.com/AlreadyBored/nodejs-assignments/blob/main/assignments/crud-api/assignment.md
  2. Done: 19.06.2022 / deadline 19.06.2022
  3. Score: 202/ 202

Basic Scope
+10 The repository with the application contains a Readme.md file containing detailed instructions for installing, running and using the application
+10 GET api/users implemented properly
+10 GET api/users/${userId} implemented properly
+10 POST api/users implemented properly
+10 PUT api/users/{userId} implemented properly
+10 DELETE api/users/${userId} implemented properly
+6 Users are stored in the form described in the technical requirements
+6 Value of port on which application is running is stored in .env file
Advanced Scope
+30 Task implemented on Typescript
+10 Processing of requests to non-existing endpoints implemented properly
+10 Errors on the server side that occur during the processing of a request should be handled and processed properly
+10 Development mode: npm script start:dev implemented properly
+10 Production mode: npm script start:prod implemented properly
Hacker Scope
+30 There are tests for API (not less than 3 scenarios)
+30 There is horizontal scaling for application with a load balancer

  1. How to Install The Application:

Use your terminal command line interface

"git clone https://github.com/Ihar-dev/CRUD-API.git" or

"git clone git@github.com:Ihar-dev/CRUD-API.git"

then

"cd CRUD-API"
"git checkout develop"
"npm i"

  1. How to Use The Aplication:

"npm run start:prod" to run the app in production mode with nodemon

"npm run start:dev" to run the app in development mode with nodemon

"npm run start:multi" to run the app in multi mode with nodemon

"npm run start" to run the app with node

then
use Postman, VS Code Thunder Client or Front-end application

  1. Endpoints:

GET method "localhost:4000/api/users" Gets All Users

GET method "localhost:4000/api/users/:userId" Gets Single User

POST method "localhost:4000/api/users" Creates a User

PUT method "localhost:4000/api/users/:userId" Updates a User

DELETE method "localhost:4000/api/users/:userId" Deletes a User

Users are stored as objects that have following properties:
id — unique identifier (string, uuid) generated on server side
username — user's name (string, required)
age — user's age (number, required)
hobbies — user's hobbies (array of strings or empty array, required)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant