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. node express新项目默认主文件app.js

    var express = require('express'); var path = require('path'); var favicon = require('serve-favicon') ...

  2. hive streaming 使用shell脚本

    一.HIVE streaming 在Hive中,需要实现Hive中的函数无法实现的功能时,就可以用Streaming来实现.其原理可以理解成:用HQL语句之外的语言,如Python.Shell来实现这 ...

  3. ps去水印

    使用仿制图章工具去除使用仿制图章工具去除文字这是比较常用的方法,具体的操作是,选取仿制图章工具,按住Alt键,在无文字区域点击相似的色彩名图案采样,然后在文字区域拖动鼠标复制以覆盖文字.要注意的是,采 ...

  4. LightOJ1036 A Refining Company(DP)

    题目大概说有一个n*m的格子地图,每个格子有铀或者镭矿.地图最北面的镭矿加工厂,最西面有铀矿加工厂,而要通过在格子里铺设由南向北(镭)或由东向西(铀)的轨道来送矿物到加工厂.一个格子只能铺设一种轨道, ...

  5. C# 格式化字符串,日期,字符串操作汇总

    时间格式化 有时候我们要对时间进行转换,达到不同的显示效果 默认格式为:2005-6-6 14:33:34 如果要换成成200506,06-2005,2005-6-6或更多的该怎么办呢 我们要用到:D ...

  6. 最长上升子序列[LIS]

    算法原理很简单,不再赘述,这里贴一个函数模板,传入的参数为序列首尾元素的指针. template<typename T> int LIS_nlogn(T * s, T * e) { ; T ...

  7. BZOJ4157 : 星际瘟疫

    首先剔除所有从$R$不可到达的点,然后用Lengauer-Tarjan算法建立出以$R$为起点的Dominator Tree. 那么对于每个询问,求出那些点的父亲的LCA,那么答案就是LCA到根路径上 ...

  8. BZOJ3542:DZY Loves March

    询问是要求 $\sum_{i=1}^n((x[i]-a)^2+(y[i]-b)^2)(x[i]=a||y[i]=b)$ 即求 $\sum_{i=1}^n(x[i]-a)^2(y[i]=b)+\sum_ ...

  9. mybatis 查询缓存问题

    <settings> <setting name="localCacheScope" value="STATEMENT" /> < ...

  10. jsp页面中创建方法

    在JSP页面中是用 <%! void function(){ } %> 这种方式可以定义函数. 如果只使用 <% //todo %> 代码块中的代码在编译时将会都被加到 sev ...