Code files
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
'use strict';
|
||||
|
||||
module.exports.connection = function(server, config) {
|
||||
server.connection({
|
||||
host: config.connections[0].server.host,
|
||||
port: config.connections[0].server.port,
|
||||
labels: config.connections[0].server.labels
|
||||
});
|
||||
};
|
||||
|
||||
// register plugin
|
||||
module.exports.register = function (server, options, next) {
|
||||
require('./routes')(server);
|
||||
next();
|
||||
};
|
||||
|
||||
module.exports.register.attributes = {
|
||||
pkg: require('./package.json')
|
||||
};
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "server",
|
||||
"version": "1.0.0"
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function(server) {
|
||||
server.route({
|
||||
method: 'GET',
|
||||
path: '/',
|
||||
handler: function (request, reply) {
|
||||
reply.view('index');
|
||||
}
|
||||
});
|
||||
server.route({
|
||||
method: 'GET',
|
||||
path: '/hello',
|
||||
handler: function (request, reply) {
|
||||
const data = {
|
||||
message1: 'Hello',
|
||||
message2: 'Paris, France'
|
||||
};
|
||||
reply.view('hello', data);
|
||||
}
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user