node

node笔记

1.node安装

官网下载

2.常用命令

require导入模块

3.npm

初始化
npm init -y
npm i 包名
全局安装
npm i 包名 -g
开发模式
npm i 包名 -D
卸载包
npm uni 包名 

4.框架express框架

引入
 const APP = require('express')();
get请求 
    APP.get('/', function (req, res) {
        res.send('hello');
    });
    post请求
     APP.post('/',function (req,res) {
 	res.send('post data');
 });
 
    监听端口
    APP.listen(3000,function () {
        console.log('running...');
    });

posted @ 2020-07-24 12:26  彼_岸  阅读(93)  评论(0编辑  收藏  举报