Express Server

This example express.js server for sign-up/sign-in and upload/get/download file.

Requirements

Installation

npm install

Usage

Run external service with Docker

Create necessary volume by running:

docker volume create mydb

Then run docker-compose to start MySQL:

docker-compose up -d

Start server

To start server you need at the first compile

npm run watch

After successfully compiling you can start server

npm start

Send request with Postman

Add Postman collection from ./postman_collection.json directory into Postman.

NOTE Check your Bearer Token, is it not invalid or revoked.

sign-up

Make request sign-up-request for registration: sign-up

sign-in

Make request sign-in-request for sign in and you get your jwt token: sign-in

new-token

Make request sign-in-new-token-request for new jwt token: refresh-token

upload-file

Make request upload-file-request for upload file: upload-file

list-file

Make request file-list-request for get list files: list-file

delete-file

Make request delete-file-request for delete file by id: delete-file

get-file

Make request get-file-request for get file by id: get-file

download-file

Make request download-file-request for download file by id: download-file

update-file

Make request update-file-request for update file by id: update-file

info

Make request info-request for get info user: info

logout

Make request logout-request for logged out (revoke token): logout