Skip to content

Latest commit

 

History

History
155 lines (124 loc) · 1.55 KB

README.md

File metadata and controls

155 lines (124 loc) · 1.55 KB

humbase

This Project is Experimental

humbase is BaaS(Backend as a Service), influenced by Firebase .

run

go run main.go --config config.yaml

config

listenAddress: localhost
listenPort: 8888
auth:
  secret: test-secret
store:
  apiKey: test-store-api-key

api

auth

email and password authentication.

sign-up

POST /api/v0/auth/sign-up
{
    "email": "[email protected]",
    "password": "passw0rd"
}
200 Response
{
    "token": "jwt token..."
}

sign-in

POST /api/v0/auth/sign-in
Request
{
    "email": "[email protected]",
    "password": "passw0rd"
}
200 Response
{
    "token": "jwt token..."
}

verify

POST /api/v0/auth/verify
Request
{
    "token": "jwt token..."
}
200 Response
{
    "status": "valid"
}

sign-out

DELETE /api/v0/auth/sign-out
Request
{
    "token": "jwt token..."
}
200 Response
{}

store

key value store used Golang map[string]interface{}

Request Header

Content-Type: application/json
humbase-store-api-key: apiKey-specified-in-config

findAll

GET /api/v0/store
Request
{}
200 Response
{
    "data": [
        "unique id...": {
            
        }
    ]
}

findByID

GET /api/v0/store/:id
Request
{}
200 Response
{
    "data": {

    }
}

put

create or update(overwrite data)

POST /api/v0/store
Request
{
    "id": "unique id",
    "data": {

    }
}
200 Response
{
    "data": {
        "unique id": {

        }
    }
}

del

delete key and data

DELETE /api/v0/store/:id
Request
{}
200 Response
{}