Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
src/routes/landingPageHtml.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
| 1 |
import type { Request, Response } from "express";
|
| 2 |
|
| 3 |
export function getLandingPageHtml(req: Request, res: Response): void {
|
| 4 |
-
const
|
|
|
|
|
|
|
| 5 |
res.setHeader("Content-Type", "text/html; charset=utf-8");
|
| 6 |
res.send(`
|
| 7 |
<!DOCTYPE html>
|
|
|
|
| 1 |
import type { Request, Response } from "express";
|
| 2 |
|
| 3 |
export function getLandingPageHtml(req: Request, res: Response): void {
|
| 4 |
+
const host = req.get("host");
|
| 5 |
+
const protocol = host && host.endsWith(".hf.space") ? "https" : req.protocol;
|
| 6 |
+
const baseUrl = `${protocol}://${host}/v1`;
|
| 7 |
res.setHeader("Content-Type", "text/html; charset=utf-8");
|
| 8 |
res.send(`
|
| 9 |
<!DOCTYPE html>
|