超快速30秒環境建置
quasar init pwa game
(如果出現找不到quasar指令 請先安裝qausar)
cd game
npm install
npm install -g express
npm install -g express-generator
express nodejs
cd nodejs
npm install
現在目錄結構長這樣
game
|_ bulid
|_ config
|_ node_modules
|_ nodejs
|_ bin
|_ node_modules
|_ public
|_ routes
|_ views
app.js
package.json
|_ src
|_ templates
.babelrc
.editorconfig
.eslintrc.js
.gitignore
.stylintrc
package.json
README.md
view我們不需要就先刪掉
rm -rf views
後端的package.json比較重要就貼一下
{
"name": "nodejs",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node ./bin/www"
},
"dependencies": {
"body-parser": "~1.18.2",
"cookie-parser": "~1.4.3",
"debug": "~2.6.9",
"express": "~4.15.5",
"jade": "~1.11.0",
"morgan": "~1.9.0",
"serve-favicon": "~2.4.5"
}
}
開始開發吧!
cd ..
quasar dev --play