Skip to content

Instantly share code, notes, and snippets.

@elgreatly
Created December 21, 2018 19:20
Show Gist options
  • Save elgreatly/667541976c0ef0e2fab9b6362aa5eeab to your computer and use it in GitHub Desktop.
Save elgreatly/667541976c0ef0e2fab9b6362aa5eeab to your computer and use it in GitHub Desktop.
app.js
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var bodyParser = require('body-parser');
var http = require('http');
const fetch = require('node-fetch');
const url = require('url');
const rendertron = require('rendertron-middleware');
var app = express();
app.use(rendertron.makeMiddleware({
proxyUrl: 'http://www.example.com/render',
}));
app.use(express.static(path.join(__dirname, 'dist')));
app.use('*', express.static(path.join(__dirname, 'dist')));
module.exports = app;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment