mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
Delete comments.
This commit is contained in:
@@ -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) => {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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']
|
||||
|
||||
Reference in New Issue
Block a user