fatsify核心功能示例测试!!!
This commit is contained in:
30
node_modules/fastify/examples/benchmark/simple.js
generated
vendored
Normal file
30
node_modules/fastify/examples/benchmark/simple.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
'use strict'
|
||||
|
||||
const fastify = require('../../fastify')({
|
||||
logger: false
|
||||
})
|
||||
|
||||
const schema = {
|
||||
schema: {
|
||||
response: {
|
||||
200: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
hello: {
|
||||
type: 'string'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fastify
|
||||
.get('/', schema, function (req, reply) {
|
||||
reply
|
||||
.send({ hello: 'world' })
|
||||
})
|
||||
|
||||
fastify.listen({ port: 3000 }, (err, address) => {
|
||||
if (err) throw err
|
||||
})
|
||||
Reference in New Issue
Block a user