assemble/server/public.js

17 lines
372 B
JavaScript

const express = require("express");
const {resolve} = require("node:path");
const {app} = require("./http");
app.use(
express.static(
resolve(__dirname,"../public"),
{
acceptRanges: true,
etag: true
}
)
);
app.get("*",function(request, response){
response.sendFile(resolve(__dirname,"../public/index.html"))
})