Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
fastify
GitHub Repository: fastify/point-of-view
Path: blob/main/benchmark/setup.js
106 views
1
'use strict'
2
3
process.env.NODE_ENV = 'production'
4
5
const fastify = require('fastify')()
6
const path = require('node:path')
7
8
module.exports = function ({ engine, route, options = {}, pluginOptions }) {
9
fastify.register(require('../index'), {
10
engine,
11
options,
12
root: path.join(__dirname, '../templates'),
13
...pluginOptions
14
})
15
16
fastify.get('/', route)
17
18
fastify.listen({ port: 3000 }, err => {
19
if (err) throw err
20
console.log(`server listening on ${fastify.server.address().port}`)
21
})
22
23
return fastify
24
}
25
26