diff --git a/bin/server.js b/bin/server.js index d235a15..4ff8fda 100644 --- a/bin/server.js +++ b/bin/server.js @@ -68,6 +68,11 @@ class Server { app.use(passport.initialize()) app.use(passport.session()) + // Enable CORS for testing + // THIS IS A SECURITY RISK. COMMENT OUT FOR PRODUCTION + // Dev Note: This line must come BEFORE controllers.attachRESTControllers() + 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 +80,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}`) @@ -97,13 +98,6 @@ class Server { await controllers.attachControllers(app) } - // ipfs-coord has a memory leak. This app shuts down after 4 hours. It - // expects to be run by Docker or pm2, which can automatically restart - // the app. - setTimeout(function () { - process.exit(0) - }, 60000 * 60 * 2) // 2 hours - return app } catch (err) { console.error('Could not start server. Error: ', err) diff --git a/src/adapters/fullstack-jwt.js b/src/adapters/fullstack-jwt.js index 33d7248..dcd7f1e 100644 --- a/src/adapters/fullstack-jwt.js +++ b/src/adapters/fullstack-jwt.js @@ -52,12 +52,6 @@ class FullStackJWT { // Get's a JWT token from FullStack.cash. async getJWT () { try { - // Skip connecting FullStack.cash auth server to the network if this is an E2E test. - if (process.env.TEST_TYPE === 'e2e') { - this.apiToken = 'faketoken' - return this.apiToken - } - // Log into the auth server. await this.jwtLib.register()