Projektstart
This commit is contained in:
14
backend/node_modules/@fastify/send/examples/simple.js
generated
vendored
Normal file
14
backend/node_modules/@fastify/send/examples/simple.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
'use strict'
|
||||
|
||||
const http = require('http')
|
||||
const send = require('..')
|
||||
const path = require('path')
|
||||
|
||||
const indexPath = path.join(__dirname, 'index.html')
|
||||
|
||||
const server = http.createServer(function onRequest (req, res) {
|
||||
send(req, indexPath)
|
||||
.pipe(res)
|
||||
})
|
||||
|
||||
server.listen(3000)
|
||||
Reference in New Issue
Block a user