You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
1.2 KiB
Markdown

5 years ago
# bit4sat
5 years ago
## Installation
- init/install the right node version in `.nvmrc`
```
nvm install $(cat .nvmrc)
nvm use
```
5 years ago
- install yarn (optional)
5 years ago
`sudo apt update && sudo apt install -y yarn`
- install deps
`yarn`
5 years ago
or with npm
`npm install`
## start dev server
With yarn:
`yarn run start`
or with npm
`npm start`
5 years ago
## Backend Server
Run:
```
> git submodule init
> git submodule update
```
The go server will be find in the server folder. To Run it use:
```
> cd server
> make
> ./bit4sat
```
5 years ago
## API
These are the currently available API endpoints:
- `POST` on `/upload`:
Accept a form with content type `application/json` with following structure:
``` json
{
"files": {
"name": "this is the name/path of file (required)",
"size": "size of file (not required)",
"sha256": "sha256 (not required)"
},
"timestamp": "timestamp as in Date().toJSON() in js"
}
```
Example API call:
``` bash
curl -sX POST \ Fri 19:10
--header 'content-type: application/json' 'localhost:8880/upload/' \
--data '{"files":[], "timestamp": "2012-04-23T18:25:43.511Z" }'
```