Giter Club home page Giter Club logo

crud-api's Introduction

crud-api

Prerequisites

  1. Clone repo locally: https://github.com/tuto4ki/crud-api
git clone [email protected]:tuto4ki/crud-api.git
  1. Go to branch develop
git checkout develop
  1. To install all dependencies
npm install
  1. Run develop version
npm run start:dev
  1. Check server

POST/PUT requests with Postman: send the request body by selecting raw and insert it into the field, for example:

{
    "username": "Tamara",
    "age": 64,
    "hobbies": ["Music", "Dancing"]
}

Details

  1. Endpoint api/users:

    • GET api/users get all persons
    • GET api/users/{userId} get person with {userId}
    • POST api/users create record about new user and store it in database
    • PUT api/users/{userId} update existing user
    • DELETE api/users/{userId} delete existing user from database
  2. Users 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)
  3. Requests to non-existing endpoints: server answer with status code 404 and message Route not found

  4. Errors on the server side that occur during the processing of a request: server answer with status code 500 and message Server error

  5. There 2 modes of running application (development and production):

    • The application is run in development mode
    npm run start:dev
    • The application is run in production mode
    npm run start:prod

crud-api's People

Contributors

tuto4ki avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.