Browse Source

proxy requests through dev server to avoid cors for now

master
Colin Megill 6 years ago
parent
commit
c2e9e9f9e1
  1. 1
      .eslintignore
  2. 22
      dev-server.js

1
.eslintignore

@ -1,2 +1,3 @@
dist/*
node_modules/*
dev-server.js

22
dev-server.js

@ -14,6 +14,28 @@ app.use(require("webpack-dev-middleware")(compiler, {
app.use(require("webpack-hot-middleware")(compiler));
app.get("/Zika_meta", function(req, res) {
request("http://nextstrain.org/data/Zika_meta.json", function(err,r) {
if (err) {console.log('error getting data', err)}
// console.log(r.toJSON())
res.send(r.toJSON());
});
});
app.get("/Zika_tree", function(req, res) {
request("http://nextstrain.org/data/Zika_tree.json", function(err,r) {
if (err) {console.log('error getting data', err)}
res.send(r.toJSON());
});
});
app.get("/Zika_sequences", function(req, res) {
request("http://nextstrain.org/data/Zika_sequences.json", function(err,r) {
if (err) {console.log('error getting data', err)}
res.send(r.toJSON());
});
});
app.get("*", function(req, res) {
res.sendFile(path.join(__dirname, "index.html"));
});

Loading…
Cancel
Save