2020-11-20 00:16:31 +00:00
|
|
|
import consola from 'consola'
|
|
|
|
import { extendPreset, hl, prettyPath } from '../utils'
|
2021-01-22 19:55:59 +00:00
|
|
|
import { NitroPreset, NitroContext } from '../context'
|
2020-11-20 00:16:31 +00:00
|
|
|
import { node } from './node'
|
|
|
|
|
2021-01-22 19:55:59 +00:00
|
|
|
export const server: NitroPreset = extendPreset(node, {
|
2020-11-20 00:16:31 +00:00
|
|
|
entry: '{{ _internal.runtimeDir }}/entries/server',
|
2020-11-28 22:49:39 +00:00
|
|
|
serveStatic: true,
|
2020-11-20 00:16:31 +00:00
|
|
|
hooks: {
|
2021-01-22 19:55:59 +00:00
|
|
|
'nitro:compiled' ({ output }: NitroContext) {
|
2020-11-20 00:16:31 +00:00
|
|
|
consola.success('Ready to run', hl('node ' + prettyPath(output.serverDir)))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|