Created
May 9, 2018 19:23
-
-
Save jdlrobson/ab24ce96375b07bc460f7137b903aeeb to your computer and use it in GitHub Desktop.
API proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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