coyotte508 HF Staff commited on
Commit
f3942aa
·
verified ·
1 Parent(s): 6088b24

update url

Browse files
Files changed (1) hide show
  1. app.ts +6 -2
app.ts CHANGED
@@ -5,11 +5,15 @@ const app = express();
5
 
6
  app.use(
7
  "/",
8
- apiReference({
 
 
 
9
  url: "https://huggingface.co/.well-known/openapi.json",
10
  hideClientButton: true,
11
  defaultOpenAllTags: true,
12
- })
 
13
  );
14
 
15
  const port = 7860;
 
5
 
6
  app.use(
7
  "/",
8
+ (req, res, next) => {
9
+ const originalSend = res.send.bind(res);
10
+ res.send = x => originalSend(x.replace("</html>", "<script>addEventListener('hashchange', event => parent.postMessage({data: {hash: event.newURL.hash.slice(1)}}))</script></html>"))
11
+ return apiReference({
12
  url: "https://huggingface.co/.well-known/openapi.json",
13
  hideClientButton: true,
14
  defaultOpenAllTags: true,
15
+ })(req, res, next);
16
+ };
17
  );
18
 
19
  const port = 7860;