Go to file
Chakib Benziane d84b997b07 server update
2019-03-21 18:45:03 +01:00
server@aa5f7f2f9e server update 2019-03-21 18:45:03 +01:00
src Upload metadata (multifile) + wip upload files + cors 2019-03-20 19:43:14 +01:00
.babelrc initial 2019-03-13 18:07:54 +01:00
.eslintrc.js worker thread interface 2019-03-17 19:24:24 +01:00
.gitignore initial 2019-03-13 18:07:54 +01:00
.gitmodules add server submodule 2019-03-15 19:02:35 +01:00
.nvmrc initial 2019-03-13 18:07:54 +01:00
index.html wip upload component 2019-03-17 17:26:00 +01:00
package.json working init update 2019-03-19 22:14:59 +01:00
README.md Update 2019-03-15 19:18:07 +01:00
yarn.lock working init update 2019-03-19 22:14:59 +01:00

bit4sat

Installation

  • init/install the right node version in .nvmrc
nvm install $(cat .nvmrc)
nvm use
  • install yarn (optional)

sudo apt update && sudo apt install -y yarn

  • install deps

yarn

or with npm

npm install

start dev server

With yarn:

yarn run start

or with npm

npm start

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

API

These are the currently available API endpoints:

  • POST on /upload: Accept a form with content type application/json with following structure:
{
    "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:

curl -sX POST  \                                                                                                                                                     Fri 19:10
  --header 'content-type: application/json'  'localhost:8880/upload/' \
  --data '{"files":[], "timestamp": "2012-04-23T18:25:43.511Z" }'