@zmx0142857/file-share 1.0.1 → 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.
Files changed (3) hide show
  1. package/README.md +4 -1
  2. package/package.json +1 -1
  3. package/serve.js +3 -1
package/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # file-share
2
2
 
3
- ## Quick start
3
+ Start a simple file share server with one command:
4
4
 
5
5
  $ npx @zmx0142857/file-share
6
+ 🚀 server running at http://192.168.?.?:3001
7
+
8
+ Open browser and visit!
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zmx0142857/file-share",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=16.0.0"
package/serve.js CHANGED
@@ -4,6 +4,7 @@ import fileUpload from 'express-fileupload'
4
4
  import fs from 'fs'
5
5
  import path from 'path'
6
6
  import indexHtml from './index.js'
7
+ import os from 'os'
7
8
 
8
9
  const app = express()
9
10
  app.use(cors())
@@ -52,4 +53,5 @@ app.get('/', (req, res) => res.send(indexHtml))
52
53
 
53
54
  const argv = process.argv.slice(2)
54
55
  const port = argv[0] || 3001
55
- app.listen(port, () => console.log(`server is running at port http://localhost:${port}`))
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}`))