Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
const express = require('express');
const proxy = require('http-proxy-middleware')
const request = require('request');
const build = "20181223"
const domain = ""
const wordpress = '';
const app = express();
app.get('/universe/ships/:shipId', async (req, res) => {
var backend = `https://${domain}/shipsnapshot?build=${build}&shipId=${req.params.shipId}`;
app.get('/universe/leaderboards/ships', async (req, res) => {
var backend = `https://${domain}/shipLeaderboard`;
// Our final catchall is to wordpress, so in addition to blog posts, 404's etc. are also
// customized within wordpress
app.use('*', proxy({
target: wordpress,
changeOrigin: true // Needed for vitual hosts
module.exports = {
proxy: app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment