Published: https://bandapixel-test.herokuapp.com
- Setup
CORS
to allow access from any domain. - DB - any. (I chose MySQL)
- Token should have expiration time 10 mins and extend it on any user request (except
singin
/logout
)
- /signin [POST] - request for bearer token by
id
andpassword
- /signup [POST] - creation of new user
- Fields
id
andpassword
.Id
- phone number or email. After signup add fieldid_type
- phone or email - In case of successful signup - return token
- Fields
- /info [GET] - returns user id and id type
- /latency [GET] - returns service server latency for
google.com
- /logout [GET] - with param
all
:true
- removes all users bearer tokensfalse
- removes only current token
- Accesses by token middleware
- Auto refresh token cleaner from DB
- Error Handler Middleware
- Add monitoring app integration (Mezmo)
- Auto publish from Github to Heroku
- TypeScript
- Tests (jest + supertest)
- CI/CD
- Docker
- Clone project
- Create
environment variables
or create file.env
with same fields
PORT=
DB_DATABASE=
DB_HOST=
DB_PASSWORD=
DB_USER=
JWT_ACCESS_SECRET=
JWT_REFRESH_SECRET=
npm install
- For create tables - run
resetDatabases()
method fromutils.js
- Then start project by commands:
npm start
or for dev
npm run serve
Authorization required
Authorization required
Authorization required
Output:
For this page you must use Bearer jwt access token in header. And send refresh token, if you need to refresh it.
Coming soon