§2024-06-11
機器:jc4nas02.yushei.net
¶ Step 1. Create project
alexlai@hc4nas02:~/nodejs_proj$ mkdir mvc_demo && cd $_
$ fnm list
* v20.14.0 default, lts-latest
* system
$ node --version
v20.14.0
$ npm --version
10.8.1
$ npm init
$ cat package.json
{
"name": "mvc_demo",
"version": "1.0.0",
"description": "mvc model demo",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "alexlai@j2jammy.yushei.net",
"license": "ISC"
}
¶Step 2: Install Dependencies
$ npm install express mongoose winston body-parser docsify-cli
$ cat package.json
{
"name": "mvc_demo",
"version": "1.0.0",
"description": "mvc model demo",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "alexlai@j2jammy.yushei.net",
"license": "ISC",
"dependencies": {
"body-parser": "^1.20.2",
"docsify-cli": "^4.4.4",
"express": "^4.19.2",
"mongoose": "^8.4.1",
"winston": "^3.13.0"
}
}
&Step 3. npx docsify init ./docs
$ npx docsify init ./docs/
Initialization succeeded! Please run docsify serve ./docs/
alexlai@hc4nas02:~/nodejs_proj/mvc_demo$ tree docs/
docs/
├── index.html
└── README.md
0 directories, 2 files
Return to Top