/
erioxis
/
web-nodejs
Обзор
Документация
Войти
/
erioxis
/
web-nodejs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
backend/node_modules/@fastify/send/examples/simple.js
15 строк
384 B
erioxis
lab11fix
15 дек 2025, 23:21
15 дек 2025, 23:21
70dc7ba
Код
Авторство
О чём код?
'use strict' const http = require('node:http') const send = require('..') const path = require('node:path') const indexPath = path.join(__dirname, 'index.html') const server = http.createServer(async function onRequest (req, res) { const { statusCode, headers, stream } = await send(req, indexPath) res.writeHead(statusCode, headers) stream.pipe(res) }) server.listen(3000)