Skip to content

Instantly share code, notes, and snippets.

@jdlrobson
Created May 9, 2018 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdlrobson/51547c31ebf575d1c246232bc7083838 to your computer and use it in GitHub Desktop.
Save jdlrobson/51547c31ebf575d1c246232bc7083838 to your computer and use it in GitHub Desktop.
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