forked from baron/baron-sso
ci: add code check badges and coverage reports
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { createServer } from "node:http";
|
||||
import { readFile, stat } from "node:fs/promises";
|
||||
import { createServer } from "node:http";
|
||||
import { extname, join, normalize, resolve } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
@@ -24,7 +24,9 @@ const contentTypes = {
|
||||
};
|
||||
|
||||
function getContentType(filePath) {
|
||||
return contentTypes[extname(filePath).toLowerCase()] ?? "application/octet-stream";
|
||||
return (
|
||||
contentTypes[extname(filePath).toLowerCase()] ?? "application/octet-stream"
|
||||
);
|
||||
}
|
||||
|
||||
function sendJson(res, statusCode, body) {
|
||||
@@ -132,7 +134,10 @@ async function serveStatic(req, res, pathname) {
|
||||
|
||||
createServer(async (req, res) => {
|
||||
try {
|
||||
const url = new URL(req.url ?? "/", `http://${req.headers.host ?? "localhost"}`);
|
||||
const url = new URL(
|
||||
req.url ?? "/",
|
||||
`http://${req.headers.host ?? "localhost"}`,
|
||||
);
|
||||
const { pathname, search } = url;
|
||||
|
||||
if (pathname === "/api" || pathname.startsWith("/api/")) {
|
||||
@@ -149,5 +154,7 @@ createServer(async (req, res) => {
|
||||
});
|
||||
}
|
||||
}).listen(port, host, () => {
|
||||
console.log(`Adminfront production server listening on http://${host}:${port}`);
|
||||
console.log(
|
||||
`Adminfront production server listening on http://${host}:${port}`,
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user