我有一個使用npm
的環境。我的package.json如下:如何設置NodeJS Express服務器?
`{
"name": "appname",
"version": "1.0.0",
"description": "",
"main": "entry.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"babel-core": "^6.3.17",
"babel-loader": "^6.2.0",
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.3.13",
"babel-runtime": "^6.3.19",
"express": "^4.14.0"
},
"dependencies": {
"bootstrap": "^4.0.0-alpha.6",
"mongoose": "^4.7.7",
"react": "^15.4.2",
"react-dom": "^15.4.2"
}
}`
如何建立一個Node.js的+ Express服務器實際上,這樣我就可以能夠旋轉起來,去http://localhost:3000,也承擔在所有我的靜態HTML/CSS文件,以及我的React jsx文件?
您是否嘗試過Express.js網站上的入門指南? http://expressjs.com/en/starter/hello-world.html – Quentin
網上有大量的資源可以解釋如何做到這一點。 –