Skip to content
Permalink
Browse files

fix(server): build option httpProxy http verbs like put and post

  • Loading branch information
jyounce committed Nov 4, 2016
1 parent 10dc896 commit d06e4bcf56aa3e7bc6f662a916bd5fa3e9e7feb2
Showing with 14 additions and 8 deletions.
  1. +14 −8 src/src/server/start-server.coffee
@@ -16,19 +16,25 @@ process.env.NODE_ENV = 'production' if config.env.is.prod
server = {}
server.express = express
server.app = server.express()
server.middleware = { bodyParser }
server.middleware = {}
server.paths = client: clientDirPath, server: serverDirPath
server.server = require('./defaults/app-listener') server, config

# load defaults
# =============
# load default settings
# =====================
require('./defaults/app-settings') server, config
require('./defaults/app-middleware') server, config

# load optional http proxy
# ========================
proxyFilePath = path.join dir, 'options', 'http-proxy.js'
require(proxyFilePath) server.app, config if config.httpProxy.length
# load optional http proxy middleware (must go before bodyParser)
# ===================================
if config.httpProxy.length
proxyFilePath = path.join dir, 'options', 'http-proxy.js'
httpProxy = require(proxyFilePath) server.app, config
server.middleware.httpProxy = httpProxy

# load default middleware
# =======================
server.middleware.bodyParser = bodyParser
require('./defaults/app-middleware') server, config

# load optional app server dist entry script
# ==========================================

0 comments on commit d06e4bc

Please sign in to comment.
You can’t perform that action at this time.