@zmx0142857/file-share 1.0.0 → 1.0.2
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.
- package/README.md +4 -1
- package/{index.html → index.js} +3 -0
- package/package.json +1 -1
- package/serve.js +5 -2
package/README.md
CHANGED
package/{index.html → index.js}
RENAMED
package/package.json
CHANGED
package/serve.js
CHANGED
|
@@ -3,6 +3,8 @@ 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'
|
|
7
|
+
import os from 'os'
|
|
6
8
|
|
|
7
9
|
const app = express()
|
|
8
10
|
app.use(cors())
|
|
@@ -47,8 +49,9 @@ app.post('/upload', (req, res) => {
|
|
|
47
49
|
res.json({ code: 200, msg: 'ok', data })
|
|
48
50
|
})
|
|
49
51
|
|
|
50
|
-
app.get('/', (req, res) => res.send(
|
|
52
|
+
app.get('/', (req, res) => res.send(indexHtml))
|
|
51
53
|
|
|
52
54
|
const argv = process.argv.slice(2)
|
|
53
55
|
const port = argv[0] || 3001
|
|
54
|
-
|
|
56
|
+
const ip = Object.values(os.networkInterfaces()).flat().find(v => v.family === 'IPv4').address
|
|
57
|
+
app.listen(port, () => console.log(`🚀 server running at http://${ip}:${port}`))
|