Projektstart

This commit is contained in:
2026-01-22 15:49:12 +01:00
parent 7212eb6f7a
commit 57e5f652f8
10637 changed files with 2598792 additions and 64 deletions

View File

@@ -0,0 +1,35 @@
'use strict'
const t = require('tap')
const test = t.test
const Fastify = require('../..')
const h2url = require('h2url')
const msg = { hello: 'world' }
const fastify = Fastify({
http2: true
})
fastify.get('/', function (req, reply) {
reply.code(200).send(msg)
})
fastify.listen({ port: 0 }, err => {
t.error(err)
t.teardown(() => { fastify.close() })
test('http UNKNOWN_METHOD request', async (t) => {
t.plan(2)
const url = `http://localhost:${fastify.server.address().port}`
const res = await h2url.concat({ url, method: 'UNKNOWN_METHOD' })
t.equal(res.headers[':status'], 404)
t.same(JSON.parse(res.body), {
statusCode: 404,
code: 'FST_ERR_NOT_FOUND',
error: 'Not Found',
message: 'Not Found'
})
})
})