jbilcke-hf HF staff commited on
Commit
d0524ae
1 Parent(s): fd74d53
Files changed (1) hide show
  1. src/index.mts +2 -14
src/index.mts CHANGED
@@ -8,18 +8,6 @@ const hfi = new HfInference(process.env.HF_API_TOKEN)
8
  console.log('HF_ENDPOINT_URL:', process.env.HF_ENDPOINT_URL)
9
  const hf = hfi.endpoint(process.env.HF_ENDPOINT_URL)
10
 
11
- // define the CSS and JS dependencies
12
- const css = [
13
- "/css/daisyui@2.6.0.css",
14
- ].map(item => `<link href="${item}" rel="stylesheet" type="text/css"/>`)
15
- .join("")
16
-
17
- const script = [
18
- "/js/alpinejs@3.12.2.js",
19
- "/js/tailwindcss@3.3.2.js"
20
- ].map(item => `<script src="${item}"></script>`)
21
- .join("")
22
-
23
  const app = express()
24
  const port = 7860
25
 
@@ -77,7 +65,7 @@ app.get("/app", async (req, res) => {
77
 
78
  pending.queue.push(id)
79
 
80
- const prefix = `<html><head>${css}${script}`
81
  res.write(prefix)
82
 
83
  req.on("close", function() {
@@ -104,7 +92,7 @@ ${daisy}
104
  - No need to write code comments, so please make the code compact (short function names etc)
105
  - Use a central layout by wrapping everything in a \`<div class="flex flex-col items-center">\`
106
  # HTML output
107
- ${prefix}`
108
 
109
  try {
110
  let result = ''
 
8
  console.log('HF_ENDPOINT_URL:', process.env.HF_ENDPOINT_URL)
9
  const hf = hfi.endpoint(process.env.HF_ENDPOINT_URL)
10
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  const app = express()
12
  const port = 7860
13
 
 
65
 
66
  pending.queue.push(id)
67
 
68
+ const prefix = `<html><head><link href="https://cdn.jsdelivr.net/npm/daisyui@3.1.6/dist/full.css" rel="stylesheet" type="text/css" /><script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script><script src="https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio,line-clamp"></script><title>Generated content</title><body`
69
  res.write(prefix)
70
 
71
  req.on("close", function() {
 
92
  - No need to write code comments, so please make the code compact (short function names etc)
93
  - Use a central layout by wrapping everything in a \`<div class="flex flex-col items-center">\`
94
  # HTML output
95
+ <html><head></head><body`
96
 
97
  try {
98
  let result = ''