Vue+node+mysql Study Notes

Source: Internet
Author: User
Tags md5

1. Create a database

Create DatabaseVueblog; Usevueblog;/* Create administrator table for background login, field for admin number (self-growth), account, password, logon time * /Create Table if  not existsAdmin (IDintAuto_incrementPrimary Key, namevarchar( -) not NULL, Passwordvarchar( -) not NULL, Logintimevarchar( -) not NULL);

2. Create a project directory structure

1) initializing the project with VUE-CLI

# Global Installation vue-cli$ NPM install--global vue-cli# Create a new project based on Webpack template $ vue init webpack vue-blog# install dependent, walk you $ cd vue-blog$ CNPM install$ npm Run Dev

2) Create admin directory, store background related files

    • Config to store the default file
    • LIB to store operational database files
    • Middlewares store to determine whether the file is logged
    • Public Store style Files
    • Routes Storing routing files
    • Views Store template Files
    • Index Program main file

3) Install the required modules in the background

Before installing we use CNPM installation

- -- registry=https://registry.npm.taobao.org
CNPM I koa koa-bodyparser koa-mysql-session koa-router koa-session-minimal koa-static koa-views MD5 moment MySQL Ejs--sav E

Use of each module

KOA Node Framework koa-bodyparser form parsing middleware koa-mysql-session, koa-session-minimal processing database middleware Koa-router Routing middleware koa-static Static resource loading middleware Ejs template engine MD5 password encryption moment time middleware MySQL database koa-views template rendering middleware

Vue+node+mysql Study Notes

Related Article

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.