@zmx0142857/file-share 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,4 @@
1
+ const indexHtml = `
1
2
  <!DOCTYPE html>
2
3
  <html lang="zh">
3
4
  <head>
@@ -152,3 +153,5 @@
152
153
  </script>
153
154
  </body>
154
155
  </html>
156
+ `
157
+ export default indexHtml
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zmx0142857/file-share",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=16.0.0"
package/serve.js CHANGED
@@ -3,6 +3,7 @@ import cors from 'cors'
3
3
  import fileUpload from 'express-fileupload'
4
4
  import fs from 'fs'
5
5
  import path from 'path'
6
+ import indexHtml from './index.js'
6
7
 
7
8
  const app = express()
8
9
  app.use(cors())
@@ -47,7 +48,7 @@ app.post('/upload', (req, res) => {
47
48
  res.json({ code: 200, msg: 'ok', data })
48
49
  })
49
50
 
50
- app.get('/', (req, res) => res.send(fs.readFileSync('index.html', 'utf-8')))
51
+ app.get('/', (req, res) => res.send(indexHtml))
51
52
 
52
53
  const argv = process.argv.slice(2)
53
54
  const port = argv[0] || 3001