Delete comments.

This commit is contained in:
rafaelsouzaf
2017-12-10 17:08:15 -03:00
parent b1ca20cc48
commit 6a11db62bd
3 changed files with 3 additions and 17 deletions

View File

@@ -5,9 +5,6 @@ import * as Crypto from "crypto";
const preResponse = function (request: Request, h: ResponseToolkit) {
const response:ResponseObject = request.response;
// if (response.isBoom) {
// return null;
// }
const hash = Crypto.createHash('sha1');
response.events.on('peek', (chunk:any) => {

View File

@@ -48,7 +48,6 @@ const user: RouteOptions = {
};
server.route({method: 'GET', path: '/user', options: user });
//server.route({ method: 'GET', path: '/public/{path*}', options: { cache: { privacy: 'public', expiresIn: 24 * 60 * 60 * 1000 } }, handler: { directory: { path: __dirname, listing: false, index: false } } });
server.start();
console.log('Server started at: ' + server.info.uri);

View File

@@ -1,25 +1,15 @@
// https://github.com/hapijs/hapi/blob/master/API.md#-serverdecoratetype-property-method-options
import {Server} from "hapi";
import {ResponseToolkit, Server} from "hapi";
const server = new Server({
port: 8000,
});
/*
const serverRoute: ServerRoute = {
path: '/',
method: 'GET',
handler: function (request: Request, h: ResponseToolkit) {
return h.success();
}
};
const success = function () {
return this.response({ status: 'ok' });
const success = function (h: ResponseToolkit) {
return h.response({ status: 'ok' });
};
server.start();
server.decorate('toolkit', 'success', success);
*/
// TODO how to implement it with TS?
console.log(server.decorations.toolkit); // ['success']