package.json

"scripts": {
"init": "webpack --progress --config webpack.dev.config.js",
"dev": "webpack-dev-server --inline --hot --compress --history-api-fallback --config webpack.dev.config.js",
"build": "webpack --progress --hide-modules --config webpack.prod.config.js"
},

server.js —— 类似express构建http服务

'use strict'

var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
var config = require('./webpack.config');
config.entry.unshift('webpack-dev-server/client?http://localhost:8090', "webpack/hot/dev-server");
config.plugins.push(new webpack.HotModuleReplacementPlugin()); // 这里配置:请求http://localhost:9090/api,
// 相当于通过本地node服务代理请求到了http://cnodejs.org/api
var proxy = [{
target: "https://cnodejs.org",
host: "cnodejs.org",
path: "/api/*"
}]
//启动服务
var app = new WebpackDevServer(webpack(config), {
publicPath: config.output.publicPath,
hot:true,
historyApiFallback: true
,
proxy:proxy
});

app.listen(8090);

关于web-dev-server 记录的更多相关文章

  1. [转载]部署Office Web Apps Server并配置其与SharePoint 2013的集成

    Office Web Apps Server 是新的 Office 服务器产品,它提供 Word.PowerPoint.Excel 和 OneNote 的基于浏览器的版本.单个 Office Web ...

  2. 部署Office Web Apps Server并配置其与SharePoint 2013的集成

    部署Office Web Apps Server并配置其与SharePoint 2013的集成   Office Web Apps Server 是新的 Office 服务器产品,它提供 Word.P ...

  3. office web app server部署和简单操作

    部署环境:windows server 2012 R2,服务器在AD域中 参考网址: https://msdn.microsoft.com/zh-cn/magazine/jj219455(office ...

  4. 攻防世界Web刷题记录(进阶区)

    攻防世界Web刷题记录(进阶区) 1.baby_web 发现去掉URLhttp://111.200.241.244:51461/1.php后面的1.php,还是会跳转到http://111.200.2 ...

  5. web cache server方案比较:varnish、squid、nginx

    linux运维中,web cache server方案的部署是一个很重要的环节,选择也有很多种比如:varnish.squid.nginx.下面就对当下常用的这几个web cache server做一 ...

  6. Office Web Apps Server 概述

    Office Web Apps Server 是新的 Office 服务器产品,它提供 Word.PowerPoint.Excel 和 OneNote 的基于浏览器的版本.单个 Office Web ...

  7. office web apps server 问题和解决办法

    New-OfficeWebAppsFarm –InternalURL "http://owa.zjkhlib.com" –AllowHttp –EditingEnabled 错误1 ...

  8. Office Web Apps Server

    Office Web Apps Server Office Web Apps Server 是一款 Office 服务器产品,可提供针对 Office 文件的基于浏览器的文件查看和编辑服务.Offic ...

  9. office web apps server安装部署

    操作系统:windows 2012 软件下载地址: 链接:https://pan.baidu.com/s/1c3WWFs8 密码:4dcy NDP452-KB2901954-Web.exe(.Net ...

  10. Simple Web API Server in Golang (2)

    In this challenge, I tried to implement a simple OAuth2 server basing on Simple Web API Server in [1 ...

随机推荐

  1. Swift3.0语言教程使用指针创建和初始化字符串

    Swift3.0语言教程使用指针创建和初始化字符串 Swift3.0语言教程使用指针创建和初始化字符串苹果的Swift团队花了不少功夫来支持C的一些基础特性.C语言中为我们提供了指针,Swift也不例 ...

  2. Asp.net_完美设置页面最小宽度(兼容ie)

    div+css的布局相比table布局简化了前端开发的复杂性,也会带来一些问题,现在我们就说一下浮动定位在页面大小改变时布局错位的解决办法,给页面设置最小宽度: 只需更改全局css样式表 body { ...

  3. Codeforces 617E XOR and Favorite Number(莫队算法)

    题目大概说给一个序列,多次询问区间异或和为k的连续子序列有多少个. 莫队算法,利用异或的性质,通过前缀和求区间和,先处理出序列各个前缀和,然后每次区间转移时维护i以及i-1前缀和为某数的个数并增加或减 ...

  4. Extjs用到的一些有用的网页的集锦

    1. extJS常用的4中Ajax异步提交 http://www.2cto.com/kf/201403/284083.html http://blog.csdn.net/goodshot/articl ...

  5. Coder-Strike 2014 - Round 1 D. Giving Awards

    题目的意思是 老板给n个人发工资,x欠y的工资,the joy of person x from his brand new money reward will be much less, 老板想避免 ...

  6. ACM: HDU 5418 Victor and World - Floyd算法+dp状态压缩

    HDU 5418 Victor and World Time Limit:2000MS     Memory Limit:131072KB     64bit IO Format:%I64d & ...

  7. ACM: How many integers can you find-数论专题-容斥原理的简单应用+GCD

    How many integers can you find Time Limit:5000MS     Memory Limit:32768KB     64bit IO Format:%I64d ...

  8. NOIp 2013 #1 积木大赛 Label:有趣的模拟

    题目描述 春春幼儿园举办了一年一度的“积木大赛”.今年比赛的内容是搭建一座宽度为n的大厦,大厦可以看成由n块宽度为1的积木组成,第i块积木的最终高度需要是hi. 在搭建开始之前,没有任何积木(可以看成 ...

  9. nodeJS中exports和mopdule.exports的区别

    每一个node.js执行文件,都自动创建一个module对象,同时,module对象会创建一个叫exports的属性,初始化的值是 {} module.exports = {}; Node.js为了方 ...

  10. java画图程序_图片用字母画出来_源码发布

    在之前写了一篇blog:java画图程序_图片用字母画出来 主要是把一些调试的截图发布出来,现在程序调试我认为可以了(当然,你如果还想调试的话,也可以下载源码自己调试). 就把源码发布出来. 项目结构 ...