njsetn:express_routing_and_cors
  • npm install corrige souvent bien des problèmes.
(...)
var express = ...
var cors = require("cors");

var skierTerms = [{term:"",defined:""},{...},...]; // pseudo-code

app.use...

app.use(cors()); // cross origin request truc

app.get("/dictionary-api", function(req, res) {
  res.json(skierTerms);
})

(...)
njsetn/express_routing_and_cors.txt · Last modified: 2016/03/27 20:18 by leo