Skip to content

Resetand/mister-proper

Repository files navigation

mister-proper

Api for telegram bot

Quick Start

First modify the ormconfig.json file and put your database configuration.

# install deps
npm install

# run in development mode
# server will listen the 3000 port
npm run start

# run tests
npm run test

You can run it in debug mode:

npm run debug

Run npm run swagger:generateto generate the swagger file from code.

Default endpoint

This project comes with these endpoints:

POST /auth/login

Authenticate the user, return the auth token

{
    username: "myusername",
    password: "mypassord"
}

POST /auth/login

Register the user

{
    username: "myusername",
    password: "mypassord"
}

POST auth/change-password

Change the user password, you need to put the auth token in the Authorization header

Authorization: Bearer theauthtoken

{
    username: "myusername",
    password: "mypassord"
}

Documentation

The swagger document is available at: http://localhost:3000

If you modify the endpoint documentation or add a new one, run the following command:

npm run swagger:generate

Production

To build the production files:

npm run build

# start the server
node build/lib/server.js

Docker

You can use docker during your developement process. First, build the docker image:

docker build -t myapp .

And run it:

docker run -p 3000:3000 -v $(pwd):/usr/src/app myapp

About

NodeJS API for duty schedule bot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published