Commit 37a919bd by Jun Matsushita

Initial commit of fuge system

parents
Pipeline #627 skipped in 0 seconds
coverage
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz
pids
logs
results
node_modules
npm-debug.log
mochahelper.js
.idea/
.settings/
dist
.tmp
.sass-cache
app/bower_components
options.mine.js
db/
data/
check:
global:
statements: 50
lines: 50
branches: 50
functions: 50
excludes: []
each:
statements: 50
lines: 50
branches: 50
functions: 50
excludes: []
{
"node": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 2,
"latedef": true,
"newcap": true,
"noarg": true,
"quotmark": "single",
"undef": true,
"unused": true,
"strict": true
}
FROM node:4
ADD package.json /
RUN npm install
ADD . /
CMD node index.js
'use strict';
var Hapi = require('hapi');
var services = require('./services');
var server = new Hapi.Server();
server.connection({
port: Number(process.env.SERVICE_PORT),
host: process.env.SERVICE_HOST
});
services(server);
server.register({
register: require('good'),
options: {opsInterval: 1000,
reporters: [{reporter: require('good-console'), events: { log: '*', response: '*' }}]}},
function(err) {
if (err) { throw err; }
server.start(function() {
console.log('listening on port: ' + process.env.SERVICE_PORT);
});
});
{
"name": "api",
"description": "my awesome site",
"keywords": [
"awesome",
"site"
],
"version": "0.1.0",
"main": "./index.js",
"engines": {
"node": "*"
},
"dependencies": {
"chairo": "^2.0.0",
"good": "^6.4.0",
"good-console": "^5.1.0",
"hapi": ">=11.x.x"
},
"repository": {
"private": true
},
"scripts": {
"lint": "jshint **/*.js",
"test": "jshint **/*.js && tape test/*Test.js",
"coverage": "istanbul cover tape test/*Test.js && open ./coverage/lcov-report/index.html",
"coverage-check": "istanbul cover tape test/*Test.js && istanbul check-coverage",
"commit-check": "jshint **/*.js && istanbul cover tape test/*Test.js && istanbul check-coverage"
},
"pre-commit": [
"commit-check"
],
"devDependencies": {
"pre-commit": "^1.1.1",
"tape": "^4.2.0"
}
}
'use strict';
module.exports = function(server) {
server.register(require('chairo'), function(err) {
var seneca = server.seneca;
seneca.client({
host: process.env.PROXY_HOST,
port: process.env.email_PORT,
pin: 'role:email'});
server.route({
method: 'POST',
path: '/email/submit',
handler: function(request, reply) {
console.log(request.payload)
seneca.act({role: 'email', cmd: 'submit'}, request.payload , function(err, res) {
reply({result: err ? 'error' : res, err: err});
});
}
});
});
};
'use strict';
process.env.SERVICE_PORT = 3000;
process.env.SERVICE_HOST = 'localhost';
var test = require('tape');
require('../index');
test('shutdown', function(t) {
t.plan(1);
t.equal(1, 1);
setTimeout(function() { process.exit(0); }, 1000);
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment