Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
const express = require("express");
const path = require("path");
const getTranslatedServer = (lang) => {
const targetServerPath = path.join(
const server = require(`${targetServerPath}/main.js`);
function run() {
const port = process.env.PORT || 4200;
// Start up the Node server
const serverES = getTranslatedServer("es");
console.log(`Node Express server ES is Ready`);
const serverEN = getTranslatedServer("en");
console.log(`Node Express server EN is Ready`);
const server = express();
server.use("/es", serverES);
server.use("/en", serverEN);
server.use("", serverEN);
server.listen(port, () => {
console.log(`Node Express server listening on http://localhost:${port}`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment