文件:app.js

    1. const express = require('express')
    2. const app = express()
    3. const port = 3000
    4. app.get('/', (req, res) => {
    5. res.send('这是Express响应')
    6. })
    7. app.listen(port, () => {
    8. console.log(`Example 运行在 ${port} 端口上`)
    9. })
    1. node app.js

    http://localhost:3000/