Skip to content

ViktoryaSVA/SimpleApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SimpleApp

Installation

$ npm install

Docker configuration

$ docker-compose up -d

Running the app

#migrations
$ npm run migration:generate
$ npm run migration:run

# development
$ npm start

Configure .env file

You should create the Postgres db and configure the .env file with that date.

POSTGRES_USER='some user'

POSTGRES_PASSWORD='some password'

POSTGRES_DB='some db name'

POSTGRES_PORT='some port'

JWT_SECRET='secretKay'

List of available roles

    ADMIN = 'admin',
    BOSS = 'boss',
    REGULAR = 'regular',

Examples of requests

CreateUser

POST

{
    "email": "[email protected]",
    "password": "regula54r443254",
    "username": "regul45ar54",
    "role": "regular",
    "bossId": 3
}

Login

POST

{
    "email": "[email protected]",
    "username": "boss",
    "password": "boss111",
    "role": "boss"
}

Get users by id

GET

Example

http://localhost:3000/users/7

Change boss

PATCH

Example

http://localhost:3000/users/7/change-boss
{
    "email": "[email protected]",
    "password": "regula54r443254",
    "username": "regul45ar54",
    "role": "regular",
    "bossId": 4
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published