After Chrome 58, self-signed certificate without SAN is not valid anymore.
openssl genrsa -des3 -out example.com.key 2048
{ | |
"environment": "staging" | |
} |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Worker Polyfill</title> | |
<script src="polyfill.worker.js"></script> | |
</head> | |
<body> | |
<h1>Worker Polyfill</h1> | |
<script> |
server { | |
listen 8080; | |
server_name example.com; | |
location / { | |
#proxy_set_header X-Prerender-Token YOUR_TOKEN; | |
set $prerender 0; | |
if ($http_user_agent ~* "googlebot|bingbot|yandex|baiduspider|twitterbot|facebookexternalhit|rogerbot|linkedinbot|embedly|quora link preview|showyoubot|outbrain|pinterest|slackbot|vkShare|W3C_Validator") { |
/** | |
* Created by common on 2016/11/21. | |
*/ | |
;(function ($) { | |
var _ajax = $.ajax; | |
$.extend({ | |
/** | |
* 重写ajax实现 | |
* 主要封装了接口在未登录的情况下调用,弹窗登入弹窗 | |
* 比juqery的ajax多了一个可配置参数 noIdentity |
/** | |
* Model base class | |
*/ | |
const asyncActionFactry = Symbol("asyncActionFactry"); | |
export class Model { | |
static getInstance = function(clazz) { | |
const instance = new clazz(); | |
instance.createActions(); | |
return instance; |
import { | |
applyMiddleware, | |
compose, | |
createStore as reduxCreateStore | |
} from "redux"; | |
import thunk from "redux-thunk"; | |
import { combineReducers } from "redux"; | |
import { Model } from "./model"; | |
const reducerMap = {}; |
<Switch> | |
{routes.map((route, i) => ( | |
<Route | |
key={`route--${i}`} | |
path={route.path} | |
exact={route.exact} | |
strict={route.strict} | |
location={previousLocation || location} | |
render={props => | |
React.createElement(route.component, { |
export async function loadInitialProps (routes, path, ctx) { | |
const initialPropsPromises = []; | |
const isMatchedComponent = routes.find (route => { | |
const match = matchPath (path, route); | |
//if matched, judge compoent and getInitialProps is existed | |
if ( | |
match && | |
route.component && | |
(route.component.getInitialProps || route.component.load) |
server | |
.disable("x-powered-by") | |
.use(express.static(process.env.RAZZLE_PUBLIC_DIR)) | |
.configProxy() | |
.get("/*", (req, res) => { | |
const { url } = req; | |
const branch = matchRoutes(staticRoutes, url); | |
const context = {}; | |
const promises = branch.map(({ route, match }) => { | |
const { component } = route; |