rZinnatov / remoteslp-lss

Learning session service for RemoteSLP project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status codecov

Overview

Learning session service for RemoteSLP project

The service provides a client with a learning session

Learning session contains all the state and the results of ongoing and finished learnings

How to run

via Docker

$ docker run -p 7070:80 rzinnatov/remoteml-lss:latest

To ensure the service is up you can try to GET sessions of a not existing user. Empty array [] should be returned.

$ curl http://localhost:7070/api/v1/sessions/not-existing-user-id
[]

via Node

  1. Clone or download this repository
  2. $ mv example.settings.json settings.json
  3. Populate settings.json with real values (see comments inside)
  4. $ npm start

API

Error while any request

Status >=400

{
    "error": "error message"
}

Get session

Request

GET /session/<session-id>

Responses

Status 200

{
    "id": "string",
    "userId": "string",
    "state": Integer
}

Status 404

{
    "error": "session with id '<session-id>' is not found"
}

Get all sessions of an user

Request

GET /sessions/<user-id>

Responses

Status 200

[
    {
        "id": "string",
        "userId": "string",
        "state": Integer
    },{
        "id": "string",
        "userId": "string",
        "state": Integer
    },
...
]

Create session

Request

POST /session

{
    "userId": "string"
}

Responses

Status 200

{
    "id": "string",
    "userId": "string",
    "state": Integer
}

Update session

Request

PUT /session

{
    "id": "string",
    "userId": "string",
    "state": Integer
}

Responses

Status 200

{
    "modifiedCount": Integer
}

Delete session

Request

DELETE /session/<session-id>

Responses

Status 200

{
    "deletedCount": Integer
}

Delete all sessions of an user

Request

DELETE /sessions/<user-id>

Responses

Status 200

{
    "deletedCount": Integer
}

Delete all sessions

Request

DELETE /sessions/

Responses

Status 200

{
    "deletedCount": Integer
}

About

Learning session service for RemoteSLP project

License:MIT License


Languages

Language:JavaScript 98.3%Language:Shell 1.5%Language:Dockerfile 0.2%