Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
update url
Browse files
app.ts
CHANGED
@@ -5,11 +5,15 @@ const app = express();
|
|
5 |
|
6 |
app.use(
|
7 |
"/",
|
8 |
-
|
|
|
|
|
|
|
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;
|