destructure node:http
This commit is contained in:
parent
a236a10cc2
commit
3f95251302
1 changed files with 4 additions and 4 deletions
|
|
@ -1,11 +1,11 @@
|
||||||
import createServer from "@tomphttp/bare-server-node";
|
import createBareServer from "@tomphttp/bare-server-node";
|
||||||
import http from "http";
|
import { createServer } from "node:http";
|
||||||
import serveStatic from "serve-static";
|
import serveStatic from "serve-static";
|
||||||
import { publicPath } from "ultraviolet-static";
|
import { publicPath } from "ultraviolet-static";
|
||||||
|
|
||||||
const bare = createServer("/bare/");
|
const bare = createBareServer("/bare/");
|
||||||
const serve = serveStatic(publicPath, { fallthrough: false });
|
const serve = serveStatic(publicPath, { fallthrough: false });
|
||||||
const server = http.createServer();
|
const server = createServer();
|
||||||
|
|
||||||
server.on("request", (req, res) => {
|
server.on("request", (req, res) => {
|
||||||
if (bare.shouldRoute(req)) {
|
if (bare.shouldRoute(req)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue