๐ a space api microservice
An Editor for easy editing is provided on /editor
.
A widget for displaying the door status is provided on /door
.
Get space api data.
Post new api data. Returns the new api state on success. An authentication token is needed.
{
"api": {
"space": "Chaostreff Flensburg"
//...
},
"token": "your-api-token"
}
An endpoint to post new door status through url-queries. An authentication token is needed.
$ curl --request POST http://localhost:3000/door?open=true&token=your-token
Create a new authentication token. Returns the new token on success. An authentication token is needed.
{
"token": "your-api-token"
}
A token can also be created with the TOKEN
env-variable on startup.
$ TOKEN=your-token npm start
Clone the repo and follow the build instructions under Build Setup.
A node.js version of 10.4
or higher is needed. Older versions may work, but are not tested.
Older databases can be migrated by simply copying the *.db
files from the ./data
directory.
$ docker run -d --name heliopause -p 8080:80 -v ./data:/app/data roikiermedia/heliopause
An example docker-compose.yml is also provided.
If the same host volume is used, the data will be persisted automatically.
# install dependencies
$ npm install # Or yarn install
# serve with hot reload at localhost:3000
$ npm run dev
# build for production and launch server
$ npm run build
$ npm start
When started with npm run dev
an authentication token dev
is created.
This project uses Prettier to format code. Prettier should be run before creating a pull request. You can run it with the default settings from your editor. For more information, refer to the official documentation.
For detailed explanation on how things work, checkout the Next.js docs.
SpaceAPI Logo & Avatar by Sebastian Morr are licensed under CC-BY-SA 4.0
Made with โก at Chaostreff Flensburg | CI & CD | License