const express = require('express') app = express() var fs = require('fs'); var contentText = fs.readFileSync('a.json','utf-8'); app.get('/',(req,res)=>res.send('hello'+contentText)) app.listen(10010,()=>console.log('listen in 10010'))
server
const express = require('express') app = express() app.use('/s',express.static('E://web')) app.listen(10011,()=>console.log('listen in 10011'))
pack.json
{ "name": "4", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo "Error: no test specified" && exit 1" }, "author": "", "license": "ISC", "dependencies": { "express": "^4.17.1" } }