Skip to content

maprox/keyholder-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Keyholder Server

Backend server for the Keyholder project

Requirements

Installation

git clone https://github.com/sunsay/keyholder-server.git
cd keyholder-server
npm install

Run

npm start

Options

  • JWT_SECRET - String used to sign jwt tokens / REQUIRED

  • PORT [3000] - Keyholder Server port

  • SSL_PORT [3443] - Keyholder Server port (SSL)

  • SSL_PRIVATE_KEY [null] - SSL Private Key

  • SSL_CERTIFICATE [null] - SSL Certificate

  • REDIS_HOST [localhost] - Redis server host

  • REDIS_PORT [6379] - Redis server port

Description

Simple key-value server for storing encrypted data

Endpoints

Requests should have application/x-www-form-urlencoded content type.

POST /sign_up

Register new account

Parameters

  • login
  • secret
  • data (Optional)

Response

{
    "token": "<JWT_TOKEN>",
    "data": "<DATA>" or null
}

POST /sign_in

Log in to the system

Parameters

  • login
  • secret

Response

{
    "token": "<JWT_TOKEN>",
    "data": "<DATA>" or null
}

GET /storage

Get storage for the logged in user.

You should add Authorization header with token which was received on sign up or sign in step to the request.

Authorization: Bearer <JWT_TOKEN>

Response

<DATA>

PUT /storage

Update storage data for the logged in user.

You should add Authorization header with token which was received on sign up or sign in step to the request.

Authorization: Bearer <JWT_TOKEN>

Parameters

  • data

forthebadge forthebadge

About

Backend server for the keyholder project

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published