mirror of
https://git.notfire.cc/notfire/akkoma-fe.git
synced 2026-01-11 13:33:24 -08:00
ANNOYING dependency update
This commit is contained in:
parent
8964dce609
commit
a7dea2f70f
7 changed files with 4972 additions and 4997 deletions
|
|
@ -5,7 +5,7 @@ var path = require('path')
|
|||
var express = require('express')
|
||||
var webpack = require('webpack')
|
||||
var opn = require('opn')
|
||||
var proxyMiddleware = require('http-proxy-middleware')
|
||||
const { createProxyMiddleware } = require('http-proxy-middleware');
|
||||
var webpackConfig = process.env.NODE_ENV === 'testing'
|
||||
? require('./webpack.prod.conf')
|
||||
: require('./webpack.dev.conf')
|
||||
|
|
@ -33,10 +33,17 @@ var hotMiddleware = require('webpack-hot-middleware')(compiler)
|
|||
// proxy api requests
|
||||
Object.keys(proxyTable).forEach(function (context) {
|
||||
var options = proxyTable[context]
|
||||
console.log(options);
|
||||
if (typeof options === 'string') {
|
||||
options = { target: options }
|
||||
}
|
||||
app.use(proxyMiddleware(context, options))
|
||||
const targetUrl = new URL(options.target);
|
||||
// add path
|
||||
targetUrl.pathname = context;
|
||||
options.target = targetUrl.toString();
|
||||
|
||||
console.log("Proxying", context, "to", options.target);
|
||||
app.use(context, createProxyMiddleware(options))
|
||||
})
|
||||
|
||||
// handle fallback for HTML5 history API
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue