MCPcopy Create free account
hub / github.com/vercel/vercel / init

Function init

packages/node/test/fixtures/02-node-server/hapi-async/index.js:3–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1const Hapi = require('@hapi/hapi');
2
3const init = async () => {
4 const server = Hapi.server({
5 port: 3000,
6 host: 'localhost',
7 });
8
9 server.route({
10 method: 'GET',
11 path: '/{p*}',
12 handler: () => 'hapi-async:RANDOMNESS_PLACEHOLDER',
13 });
14
15 await server.start();
16 console.log('Hapi server running on %s', server.info.uri);
17};
18
19process.on('unhandledRejection', err => {
20 console.log('Hapi failed in an unexpected way');

Callers 2

initSentryFunction · 0.90
index.jsFile · 0.70

Calls 3

routeMethod · 0.80
startMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected