This repository was archived by the owner on Mar 4, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 427
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(hapi): upgrade to hapi 18 (#231)
- Loading branch information
Showing
4 changed files
with
27 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,28 @@ | ||
const Hapi = require('hapi') | ||
const consola = require('consola') | ||
const HapiNuxt = require('hapi-nuxt') | ||
const Hapi = require('@hapi/hapi') | ||
const HapiNuxt = require('@nuxtjs/hapi') | ||
|
||
const server = new Hapi.Server({ | ||
host: process.env.HOST || '127.0.0.1', | ||
port: process.env.PORT || 3000 | ||
}) | ||
function start() { | ||
const server = new Hapi.Server({ | ||
host: process.env.HOST || '127.0.0.1', | ||
port: process.env.PORT || 3000 | ||
}) | ||
|
||
server | ||
.register({ | ||
plugin: HapiNuxt | ||
await server.register({ | ||
plugin: HapiNuxt, | ||
options: {} | ||
}) | ||
.then(() => server.start()) | ||
.then(() => | ||
consola.ready({ | ||
message: `Server running at: ${server.info.uri}`, | ||
badge: true | ||
}) | ||
) | ||
.catch(err => { | ||
consola.error(err) | ||
throw err | ||
|
||
await server.start() | ||
|
||
consola.ready({ | ||
message: `Server running at: ${server.info.uri}`, | ||
badge: true | ||
}) | ||
} | ||
|
||
process.on('unhandledRejection', error => { | ||
consola.error(error) | ||
}) | ||
|
||
start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.