Skip to content

khriztianmoreno/backend-top-v29

Repository files navigation

Backend Top-v29 - 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": "12345"
}

Response:

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

Basic example Create User /api/users

Request Body:

{
  "name": "cristian moreno",
  "email": "[email protected]",
  "password": "123456",
}

Response:

{
  "name": "cristian moreno",
  "email": "[email protected]",
  "role": "USER",
}

Developing

  1. Clone the repository: git clone [email protected]:khriztianmoreno/backend-top-v29.git

  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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages