C-Service
Service code for the C-Labbook demo. The first version of C-Service API.
Getting started
0.Requirements
For the next steps, you will need the following software:
- Make sure you have the latest version of Node.js: see official installation guide;
- The project uses Git to download some required dependencies: follow the official install guide
- C-Service runs on top of CouchDB, see CouchDB's installation guide
In addition, you will need to enable CORS in CouchDB
npx add-cors-to-couchdb
1.Install Project dependencies
Installation requieres a GitLab token to download the private C-CRDTLib npm package.
Go to project root directory and:
npm install
2.Start C-Service
First, one need to compile build the project:
npm run build
Set database name and credentials and run service:
export COUCHDB_USER=my-user COUCHDB_PASSWORD=my-passwd
npm start
Note: Need to start a CouchDB server beforehand. Can customize the database URL with the environment variable COUCHDB_URL. You might need to change the binding address in the CouchDB admin panel to allow peers to connect to the database.
You can also run tests using:
export DBNAME=my-dbname COUCHDB_USER=my-user COUCHDB_PASSWORD=my-passwd
npm test
Requirements
Node: v10.15+ NPM: v6.13+
(Project might work with older Node and NPM versions)