mirror of
https://github.com/louislam/dockge.git
synced 2024-12-05 00:04:03 +00:00
53b052c1e5
* Check Typescript * Fix backend typescript issues * Update
23 lines
674 B
TypeScript
23 lines
674 B
TypeScript
import { DockgeServer } from "../dockge-server";
|
|
import { Router } from "../router";
|
|
import express, { Express, Router as ExpressRouter } from "express";
|
|
|
|
export class MainRouter extends Router {
|
|
create(app: Express, server: DockgeServer): ExpressRouter {
|
|
const router = express.Router();
|
|
|
|
router.get("/", (req, res) => {
|
|
res.send(server.indexHTML);
|
|
});
|
|
|
|
// Robots.txt
|
|
router.get("/robots.txt", async (_request, response) => {
|
|
let txt = "User-agent: *\nDisallow: /";
|
|
response.setHeader("Content-Type", "text/plain");
|
|
response.send(txt);
|
|
});
|
|
|
|
return router;
|
|
}
|
|
|
|
}
|