2-1 介绍React开发环境

npm install -g

create-react-app xxx

npm run eject   来配置webpack

2-2 ES6常用语法

其他

还有一些特性,虽然不在ES6的范围内,但是也被babel支持,普遍被大家接受和使用(需要安装插件)

·对象扩展符,函数绑定

·装饰器

·Async await

2-3 Express简介

var app = express()

app.get('/',function(){

res.send('Hello world')

})

app.listen(9083,function(){console.log(`Server is running at port 9093`)})

app.use //使用模块

2-4 MongoDB

mongoose的使用:

const DB_URL = 'mongodb://localhost:27017/imooc'
mongoose.connect(DB_URL, { useNewUrlParser: true },(err)=>{
console.log('connected');
})
 
// 文档对象模型
const User = mongoose.model('user',
new mongoose.Schema({
user: { type: String, require: true },
age: { type: Number, require: true }
}))
 
 
User.create({
name: 'imooc',
age: 18
},
function (err, doc) {
if(!err) console.log(doc)
})
 
Uesr.remove({age:18},function(){...})
 
User.update({name:'xiaoming'},{'$set':{age:26}},function(){..})
 
 
User.find({name:'xiaoming'},function(){ ... })
 
User.findOne
 
 
app.get(`/data`, function (req, res) {
User.find({},function(){
res,json(doc)
})
})
 
 
 
 
 

React开发实时聊天招聘工具 -第二章的更多相关文章

  1. React开发实时聊天招聘工具 -第一章

    第一章 课程道学 6个页面 弱化css Antd-mobile作为组件库 Redux 状态管理 React-Router 路由 Axios异步请求 后端Express框架 Socket.io 数据库: ...

  2. React开发实时聊天招聘工具 -第四章 Redux

    复杂以后 setState 就不太方便了 所以使用Redux来管理 React只负责View. Store.State.Dispatch.Reducer reducer(state,action) { ...

  3. React开发实时聊天招聘工具 -第三章 React基础知识回顾

    function a (props) { return <h1>hello world{this.props.asd}</h1> } class a extends React ...

  4. React开发实时聊天招聘工具 -第六章 登陆注册(2)

    1.bodyParser和cookieParser:   const bodyParser = require('body-parser') const cookieParser = require( ...

  5. React开发实时聊天招聘工具 -第六章 登陆注册(1)

    1.基于cookie的用户认证 express 依赖 cookie-parser 2.axios语法: axios.get('/data').then(res=>{ if(res.status= ...

  6. React开发实时聊天招聘工具 -第五章 需求分析

    Axios的使用 axios.get('/data') .then(res=>{ if(res.status==200) this.setState(data:res.data) })

  7. react+redux+react-router+node.js 开发实时聊天App 学习记录

    一.课程导学 1.React 主要解决的是UI层的问题,应用的状态需要借助Redux等状态管理. 2.前端React  +  antd-mobile UI组件库 + Redux 状态管理库 + Rea ...

  8. Vue2.5开发去哪儿网App 第二章笔记

    Vue完成  TodoList 1.默认方式 <!DOCTYPE html> <html lang="en"> <head> <meta ...

  9. Android群英传》读书笔记 (1) 第一章 Android体系与系统架构 + 第二章 Android开发工具新接触

    第一章 Android体系与系统架构 1.Dalvik 和 ARTDalvik好比是一辆可折叠的自行车,平时是折叠的,只有骑的时候,才需要组装起来用.ART好比是一辆组装好了的自行车,装好就可以骑了. ...

随机推荐

  1. Lock-less buffer management scheme for telecommunication network applications

    A buffer management mechanism in a multi-core processor for use on a modem in a telecommunications n ...

  2. hdoj 1429 胜利大逃亡(续) 【BFS+状态压缩】

    题目:pid=1429">hdoj 1429 胜利大逃亡(续) 同样题目: 题意:中文的,自己看 分析:题目是求最少的逃亡时间.确定用BFS 这个题目的难点在于有几个锁对于几把钥匙.唯 ...

  3. mvc中使用remote属性来做ajax验证

    mvc中使用remote属性来做ajax验证比較easy : [Remote("Action", "Controller", AdditionalFields ...

  4. C# Winform 模拟QQ新闻弹出框

    一开始做的时候,觉得这个太简单了.真心做的时候还是遇到了不少的坑啊. 1)循环播放新闻内容,建议使用showdialog(),不要用show(),不太好控制前后之间的停顿. 2)窗口的初始位置为有下角 ...

  5. Optional arguments

    We have seen built-in functions that take a variable number of arguments. For example range can take ...

  6. MyBatis多参数传递之注解方式示例--转

    原文地址:http://legend2011.blog.51cto.com/3018495/1015003 若映射器中的方法只有一个参数,则在对应的SQL语句中,可以采用#{参数名}的方式来引用此参数 ...

  7. P3066 [USACO12DEC]逃跑的BarnRunning Away From… 树上差分_树上倍增

    code: #include <cstdio> using namespace std; #define ll long long const int N=200005; int n,fa ...

  8. Vue总结(三)

    Vue 实例还暴露了一些有用的实例属性与方法.它们都有前缀 $,以便与用户定义的属性区分开来. var App = new Vue({ el: "#root", data: { m ...

  9. Highcharts 前端图表插件

    Highcharts 支持将图片下载成各种格式 Highcharts官网:https://www.hcharts.cn/download <div id="container" ...

  10. nginx旧版本升级新版本

        比如我们现在所用的是 nginx 是1.4 版本,过了一段时间后我们有新的稳定版 1.6 问世,我们想升级到新的版本怎么办?           1.把新版本解压.安装,然后将 sbin/ng ...