REST API made as a testing task for ERP.AERO
/signup [POST] -> {id,password} returns TokenPair
/signin [POST] -> {id,password} returns TokenPair
/logout [GET] -> {}, headers.authorization
/signin/new_token [POST] -> {}, headers.authorization (Refresh)
/info [GET] -> {}, headers.authorization (Bearer), returns User
/latency [GET] -> {}, headers.authorization (Bearer), returns Server responce latency
/file/list?page_size=X&page=Y [GET] -> {},headers.authorization (Bearer) returns File list paginated by list_size (default 10) and page (default 1)
/file/:id [GET] -> {},headers.authorization (Bearer) returns File info by id
/file/download/:id [GET] -> {}, headers.authorization (Bearer) returns Downloaded file
/file/upload [POST] -> {file}, headers.authorization (Bearer) creates new File
/file/update/:id [PUT] -> {file}, headers.authorization (Bearer) updated File by id
The Express.js normal framework layout is used.
Routes as Controllers address the Services
Prisma is used as MySQL ORM
All sensitive information is stored in .env
$ npm install
$ npm run start