This repository was archived by the owner on Mar 4, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +27
-21
lines changed Expand file tree Collapse file tree 4 files changed +27
-21
lines changed Original file line number Diff line number Diff line change 23
23
"nuxt" : " ^2.4.0" <% } %><% if (server === 'express') { %>,
24
24
"express" : " ^4.16.4" <% } else if (server === 'koa') { %>,
25
25
"koa" : " ^2.6.2" <% } else if (server === 'hapi') { %>,
26
- "hapi-nuxt" : " ^1.0.1" <% } else if (server === 'micro') { %>,
26
+ "@hapi/hapi" : " ^18.3.1" ,
27
+ "@nuxtjs/hapi" : " ^2.2.1" <% } else if (server === 'micro') { %>,
27
28
"micro" : " ^9.3.3" ,
28
29
"micro-route" : " ^2.5.0" <% } else if (server === 'fastify') { %>,
29
30
"fastify" : " ^1.13.3" <% } else if (server === 'feathers') { %>,
Original file line number Diff line number Diff line change 1
- const Hapi = require ( 'hapi' )
2
1
const consola = require ( 'consola' )
3
- const HapiNuxt = require ( 'hapi-nuxt' )
2
+ const Hapi = require ( '@hapi/hapi' )
3
+ const HapiNuxt = require ( '@nuxtjs/hapi' )
4
4
5
- const server = new Hapi . Server ( {
6
- host : process . env . HOST || '127.0.0.1' ,
7
- port : process . env . PORT || 3000
8
- } )
5
+ function start ( ) {
6
+ const server = new Hapi . Server ( {
7
+ host : process . env . HOST || '127.0.0.1' ,
8
+ port : process . env . PORT || 3000
9
+ } )
9
10
10
- server
11
- . register ( {
12
- plugin : HapiNuxt
11
+ await server . register ( {
12
+ plugin : HapiNuxt ,
13
+ options : { }
13
14
} )
14
- . then ( ( ) => server . start ( ) )
15
- . then ( ( ) =>
16
- consola . ready ( {
17
- message : `Server running at: ${ server . info . uri } ` ,
18
- badge : true
19
- } )
20
- )
21
- . catch ( err => {
22
- consola . error ( err )
23
- throw err
15
+
16
+ await server . start ( )
17
+
18
+ consola . ready ( {
19
+ message : `Server running at: ${ server . info . uri } ` ,
20
+ badge : true
24
21
} )
22
+ }
23
+
24
+ process . on ( 'unhandledRejection' , error => {
25
+ consola . error ( error )
26
+ } )
27
+
28
+ start ( )
Original file line number Diff line number Diff line change @@ -370,8 +370,9 @@ Generated by [AVA](https://ava.li).
370
370
371
371
{
372
372
dependencies: {
373
+ '@hapi/hapi': '^18.3.1',
374
+ '@nuxtjs/hapi': '^2.2.1',
373
375
'cross-env': '^5.2.0',
374
- 'hapi-nuxt': '^1.0.1',
375
376
nuxt: '^2.4.0',
376
377
},
377
378
devDependencies: {
You can’t perform that action at this time.
0 commit comments