Giter Site home page Giter Site logo

node-user_login_reg's Introduction

一个用node+express+mysql实现的用户登录、注册的小demo

克隆到本地实现的方法

1、将dbConnect.js文件的

function connectServer() {

var client = mysql.createConnection({
    host: 'localhost',
    user: 'root',
    password: '2320720405',
    database: 'SwithunHan'
})
return client;

}

方法的属性改为自己电脑上mysql的对应属性 2、在刚才的数据库中新建表table_1,table_1表中有username和password两列 3、安装依赖包:在项目的根目录打开命令行输入npm i,安装好之后输入npm start 4、在浏览器中输入127.0.0.1:3000就可以看见了

tip:在发布项目时不能总是手动重启服务器吧!所以用pm2这个包运行项目 1、安装pm2 - - - - - - npm install -g pm2 2、使用pm2运行项目 pm2 start [your app name] --watch(这样就可以在后台运行并重启服务器) 3、在使用时需要联网,不然可能出现页面找不到,因为连接数据库使用的是localhost,会通过DNS解析

node-user_login_reg's People

Contributors

swithunhan avatar

Stargazers

 avatar ignacio avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.