mirror of
https://github.com/yldio/copilot.git
synced 2024-11-28 22:20:06 +02:00
9d3903a1db
This is an initial implement that at the moment constructs the required SVG layout to be used by D3.
30 lines
583 B
JavaScript
30 lines
583 B
JavaScript
const requireDir = require('require-dir');
|
|
const plugins = require('./plugins');
|
|
const routes = requireDir('./routes');
|
|
const Hapi = require('hapi');
|
|
const path = require('path');
|
|
const fs = require('fs');
|
|
|
|
const server = new Hapi.Server();
|
|
|
|
server.connection({
|
|
host: 'localhost',
|
|
port: 8000
|
|
});
|
|
|
|
server.register(plugins, (err) => {
|
|
if (err) {
|
|
throw err;
|
|
}
|
|
|
|
Object.keys(routes).forEach((name) => {
|
|
routes[name](server);
|
|
});
|
|
|
|
server.start((err) => {
|
|
server.connections.forEach((conn) => {
|
|
console.log(`started at: ${conn.info.uri}`);
|
|
});
|
|
});
|
|
});
|