hello,world!
This commit is contained in:
parent
ce813ddab8
commit
671d1dfc03
1659
package-lock.json
generated
Normal file
1659
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
23
package.json
Normal file
23
package.json
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"name": "fileshare",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"description": "文件分享服务器",
|
||||||
|
"main": "server.js",
|
||||||
|
"scripts": {
|
||||||
|
"start": "nodemon",
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "ssh://git@nas:2222/zhaoxin/fileshare.git"
|
||||||
|
},
|
||||||
|
"keywords": [],
|
||||||
|
"author": "Zhao Xin <7176466@qq.com>",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"express": "^4.18.1"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"nodemon": "^2.0.19"
|
||||||
|
}
|
||||||
|
}
|
10
server.js
Normal file
10
server.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
const express = require('express')
|
||||||
|
const app = express()
|
||||||
|
app.get('/', (req, res) => {
|
||||||
|
res.end('hello, world!')
|
||||||
|
})
|
||||||
|
const host = 'localhost'
|
||||||
|
const port = 3000
|
||||||
|
const server = app.listen(port, host, () => {
|
||||||
|
console.log(`server is running at http://${host}:${port}`)
|
||||||
|
})
|
Loading…
Reference in New Issue
Block a user