add tag on update too
Browse files
server.js
CHANGED
|
@@ -15,7 +15,6 @@ import bodyParser from "body-parser";
|
|
| 15 |
|
| 16 |
import checkUser from "./middlewares/checkUser.js";
|
| 17 |
import { PROVIDERS } from "./utils/providers.js";
|
| 18 |
-
import { type } from "os";
|
| 19 |
|
| 20 |
// Load environment variables from .env file
|
| 21 |
dotenv.config();
|
|
@@ -137,8 +136,6 @@ app.post("/api/deploy", checkUser, async (req, res) => {
|
|
| 137 |
const repoId = `${username}/${newTitle}`;
|
| 138 |
repo.name = repoId;
|
| 139 |
|
| 140 |
-
newHtml = html.replace(/<\/body>/, `${getPTag(repoId)}</body>`);
|
| 141 |
-
|
| 142 |
await createRepo({
|
| 143 |
repo,
|
| 144 |
accessToken: hf_token,
|
|
@@ -157,6 +154,7 @@ tags:
|
|
| 157 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference`;
|
| 158 |
}
|
| 159 |
|
|
|
|
| 160 |
const file = new Blob([newHtml], { type: "text/html" });
|
| 161 |
file.name = "index.html"; // Add name property to the Blob
|
| 162 |
|
|
|
|
| 15 |
|
| 16 |
import checkUser from "./middlewares/checkUser.js";
|
| 17 |
import { PROVIDERS } from "./utils/providers.js";
|
|
|
|
| 18 |
|
| 19 |
// Load environment variables from .env file
|
| 20 |
dotenv.config();
|
|
|
|
| 136 |
const repoId = `${username}/${newTitle}`;
|
| 137 |
repo.name = repoId;
|
| 138 |
|
|
|
|
|
|
|
| 139 |
await createRepo({
|
| 140 |
repo,
|
| 141 |
accessToken: hf_token,
|
|
|
|
| 154 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference`;
|
| 155 |
}
|
| 156 |
|
| 157 |
+
newHtml = html.replace(/<\/body>/, `${getPTag(repo.name)}</body>`);
|
| 158 |
const file = new Blob([newHtml], { type: "text/html" });
|
| 159 |
file.name = "index.html"; // Add name property to the Blob
|
| 160 |
|