Wauplin HF Staff commited on
Commit
a5b5c9c
·
verified ·
1 Parent(s): 6d3b8fd

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. src/routes/landingPageHtml.ts +3 -1
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 baseUrl = `${req.protocol}://${req.get("host")}/v1`;
 
 
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>