update deploy
Browse filesFiles changed (2)
- server.js+26-4
- src/utils/consts.ts+1-1
2 unmodified lines345678997 unmodified lines1071081091101111121136 unmodified lines12012112212312412510 unmodified lines1361371381391401411421431441452 unmodified linesimport { fileURLToPath } from "url";import dotenv from "dotenv";import cookieParser from "cookie-parser";import { createRepo, uploadFile, whoAmI } from "@huggingface/hub";import { InferenceClient } from "@huggingface/inference";import bodyParser from "body-parser";97 unmodified linesif (!path) {newHtml = html.replace(/<\/body>/,`<p style="text-align: center; font-size: 12px; color: #888; margin-top: 16px;">This website has been generated by <a href="https://enzostvs-deepsite.hf.space" target="_blank">DeepSite</a> <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;"></p></body>`);}6 unmodified linestype: "space",name: path ?? "",};if (!path || path === "") {const { name: username } = await whoAmI({ accessToken: hf_token });const newTitle = title10 unmodified linesrepo,accessToken: hf_token,});}await uploadFile({repo,file,accessToken: hf_token,});return res.status(200).send({ ok: true, path: repo.name });2 unmodified lines345678997 unmodified lines1071081091101111121136 unmodified lines12012112212312412512612712810 unmodified lines1391401411421431441451461471481491501511521531541551561571581591601611621631641651661672 unmodified linesimport { fileURLToPath } from "url";import dotenv from "dotenv";import cookieParser from "cookie-parser";import { createRepo, uploadFiles, whoAmI } from "@huggingface/hub";import { InferenceClient } from "@huggingface/inference";import bodyParser from "body-parser";97 unmodified linesif (!path) {newHtml = html.replace(/<\/body>/,`<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: absolute; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">This website has been generated by <a href="https://enzostvs-deepsite.hf.space" style="color: #fff;" target="_blank" >DeepSite</a> <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;"></p></body>`);}6 unmodified linestype: "space",name: path ?? "",};let readme;if (!path || path === "") {const { name: username } = await whoAmI({ accessToken: hf_token });const newTitle = title10 unmodified linesrepo,accessToken: hf_token,});readme = `---title: ${newTitle}emoji: 🚀colorFrom: bluecolorTo: bluesdk: staticpinned: falsetags:- deepsite---Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference`;}const files = [file];if (readme) {const readmeFile = new Blob([readme], { type: "text/markdown" });readmeFile.name = "README.md"; // Add name property to the Blobfiles.push(readmeFile);}await uploadFiles({repo,files,accessToken: hf_token,});return res.status(200).send({ ok: true, path: repo.name });
40 unmodified lines4142434445464740 unmodified lines<span>I'm ready to work,</span><br />Ask me anything.</h1><img src="/arrow.svg" class="arrow" /><script></script></body></html>40 unmodified lines4142434445464740 unmodified lines<span>I'm ready to work,</span><br />Ask me anything.</h1><img src="https://enzostvs-test-enzo-lol.static.hf.space/arrow.svg" class="arrow" /><script></script></body></html>
server.js+26-4
src/utils/consts.ts+1-1