[Nodejs] Nodejs Development Personal Blog (i) preparatory work

Source: Internet
Author: User

Objective

Nodejs is a JS, Google-based V8 engine that runs on the server. The personal blog system contains additions and deletions to the database, the function is complete, and the business logic is relatively simple, is a lot of background programmers in order to detect the results of learning, the first to take the practiced hand small website program. I also contacted at the end of last year Nodejs, then casually record the small blog function points and considerations.

Language and environment

1. Go to Nodejs's official website and download the NODEJS operating environment

This is what it looks like after the installation is complete.

2. Express is a Web development framework based on the Nodejs platform, access to the Express framework's official website to learn about express usage

3. Express-session Library for handling the library that holds session information

4. mysql library, a library for linking databases and executing SQL

5. Ejs Library, front template engine

6. Body-parser Library, library for processing post requests

7. Cookie-parser Library, processing cookie Library

NPM Install xxxxxx--save

Generate Package.json
NPM Init

Enter information for the project

Create a portal file

Create a file based on the entry file name entered in the Package.json file above index.js

/* Introducing Express */ var express=require ("Express"); var application=Express (); /* Creating a server */ var appport=process.env.vcap_app_port | | 8888; Application.listen (appport,function() {    Console.log ("Application Start ... ");});

Open the browser, enter http://localhost:8888, shown below, indicating normal

[Nodejs] Nodejs Development Personal Blog (i) preparatory work

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.