Skip to content

Instantly share code, notes, and snippets.

@jdlrobson jdlrobson/proxy.js
Created May 9, 2018

Embed
What would you like to do?
API proxy
const express = require('express');
const wikiApis = require('express-wikimedia-api-proxy');
const app = express();
const cors = require('cors');
const PORT = 8090
const base = '/api/';
app.use(cors())
wikiApis(app, base, true);
app.listen(PORT)
console.log('The APIs are exposed at port:', PORT)
console.log('http://localhost:' + PORT + base + 'en.wikipedia.org/api.php');
console.log('http://localhost:' + PORT + base + 'en.wikipedia.org/rest_v1/');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.