Compare commits

...
2 Commits
Author SHA1 Message Date
Chris Troutner 6f6b5874d9 Merge pull request #13 from Permissionless-Software-Foundation/ct-unstable
fix(cors): slight tweak to avoid CORS error
2022-01-12 14:50:28 -08:00
Chris Troutner d0ef1a8669 fix(cors): slight tweak to avoid CORS error 2022-01-12 14:48:33 -08:00
+4 -4
View File
@@ -68,6 +68,10 @@ class Server {
app.use(passport.initialize())
app.use(passport.session())
// Enable CORS for testing
// THIS IS A SECURITY RISK. COMMENT OUT FOR PRODUCTION
app.use(cors({ origin: '*' }))
// Attach REST API and JSON RPC controllers to the app.
const Controllers = require('../src/controllers')
const controllers = new Controllers()
@@ -75,10 +79,6 @@ class Server {
app.controllers = controllers
// Enable CORS for testing
// THIS IS A SECURITY RISK. COMMENT OUT FOR PRODUCTION
app.use(cors({ origin: '*' }))
// MIDDLEWARE END
console.log(`Running server in environment: ${config.env}`)