Skip to content

SergioJaramilloL/backend-top-v30

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Backend Top-v23 - Make It Real 💻

Main base of the services used within the Make It Real platforms

  • Built with Node.js and Express
  • Typescript
  • Prisma ORM
  • REST API

Prerequisites

Express Router and Routes

Route HTTP Verb Route Middleware Description
/api/healthcheck GET Show a simple message
/api/users GET Get list of users
/api/users POST Creates a new users
/api/users/:id GET Get a single users
/api/users/:id DELETE Deletes a user

Usage

The use of endpoints is very simple, previously you could see a table of endpoints that you can call, if you need to create a note or log in, here we have some examples.

Authentication user /auth/local/login

Request Body:

{
  "email": "[email protected]",
  "password": "1234"
}

Response:

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImNyaXN0aWFuLm1vcmVub0BtYWtlaXRyZWFsLmNhbXAiLCJpYXQiOjE2NjEyMDgwODJ9.kPdMoVUEnyX36vi606Mc1C66yWLKKAB37GLbF0gzhBo",
  "profile": {
    "id": "62fd77a4d25acc4a4e5df3d1",
    "firstName": "JHON",
    "lastName": "Doe",
    "email": "[email protected]"
  }
}

Basic example Create User /api/users

Request Body:

{
  "name": "jhon doe",
  "email": "[email protected]",
  "password": "123456"
}

Response:

{
  "name": "jhon doe",
  "email": "[email protected]",
  "role": "USER"
}

Developing

  1. Clone the repository

  2. Run npm install to install server dependencies.

  3. Configure the env running cp .env.example .env

  4. Update .env with the required info

  5. Run the migrations: prisma migrate dev

  6. Run npm run dev to start the development server.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published