[Learn-Note]Node.js Create Simpleness Blog Part1

node.js

Node.js Create Simpleness Blog


I follow this example to implemented blog.

Refer to Creating simple blog with Node.js (express and mongodb)

1.Create Express


First let's install express

If you don't have install 'express' you must setinng on this step.

npm install -g express

The -g flag means is your express will be installing globally on your system

Useing commamd to create blog project
$ express blog-express

  create : blog-express
  create : blog-express/package.json
  create : blog-express/app.js
  create : blog-express/public
  create : blog-express/public/javascripts
  create : blog-express/public/images
  create : blog-express/public/stylesheets
  create : blog-express/public/stylesheets/style.css
  create : blog-express/routes
  create : blog-express/routes/index.js
  create : blog-express/routes/user.js
  create : blog-express/views
  create : blog-express/views/layout.jade
  create : blog-express/views/index.jade
Command is auto create package.json so we will just following command execution:
  install dependencies:
  $ cd blog-express && npm install
Then we can test whether the installation is successful
  run the app:
  $ node app

Opne browser and link to localhost:3000 test your app is work!

If the app is Correct Work you will see the following picture

Imgur

0 意見:

張貼留言