2.0.1 • Published 5 years ago
occam-server v2.0.1
Server
Occam's server portion.
Contents
Introduction
A bare-bones Express server that acts as a proxy for Occam's file system functionality.
Installation
With npm:
npm install occam-server
You can also clone the repository with Git...
git clone https://github.com/jecs-imperial/occam-server.git
...and then install the necessary modules with npm from within the project's root directory:
npm install
You will need to do this if you want to look at the examples.
Usage
const server = require('occam-server'),
necessary = require('necessary');
...
const options = {
port,
fileSystemHost,
publicDirectoryPath,
templateDirectoryPath
};
start(options, pathResolver, function() {
...
stop(function() {
...
});
});
function pathResolver(relativePath) {
...
return absolutePath;
}
Note that the NodeJS path.resolve()
function is fine as a default path resolver.
Building
Automation is done with npm scripts, have a look at the package.json
file. The pertinent commands are:
npm run build-debug
npm run watch-debug
Contact
- james.smith@openmathematics.org
- http://djalbat.com