]> git.cworth.org Git - lmno-server/commitdiff
Use the cors package to set a permissive CORS header
authorCarl Worth <cworth@cworth.org>
Sun, 3 May 2020 02:28:12 +0000 (19:28 -0700)
committerCarl Worth <cworth@cworth.org>
Sun, 3 May 2020 02:28:12 +0000 (19:28 -0700)
Specifically, with this change the server will emit a header of:

Access-Control-Allow-Origin: *

allowing requests to come from anywhere (for now).

This was necessary in the testing that Kevin is currently doing (where
he his hosting his test front-end spearately from the server).

server.js

index 4d71998302a4100998161e15bca45acd9546e7a3..64694d83610c109ae71302b5ece8f6013ffc6d4c 100644 (file)
--- a/server.js
+++ b/server.js
@@ -1,7 +1,9 @@
 const express = require("express")
+const cors = require("cors")
 const body_parser = require("body-parser");
 
 const app = express();
+app.use(cors())
 
 class Game {
   constructor() {