Giter Club home page Giter Club logo

Comments (5)

yemel avatar yemel commented on May 21, 2024

Disable CopayCrossDomain on config/express.js

  if (config.enableEmailstore) {
    var allowCopayCrossDomain = function(req, res, next) {
      if ('OPTIONS' == req.method) {
        res.send(200);
        res.end();
        return;
      }
      next();
    }
    app.use(allowCopayCrossDomain);
  }

from bitcore-node.

yemel avatar yemel commented on May 21, 2024

Disable static file serving on config/express.js:

if (config.publicPath) {
    var staticPath = path.normalize(config.rootPath + '/../' + config.publicPath);
    //IMPORTANT: for html5mode, this line must to be before app.router
    app.use(express.static(staticPath));
  }

from bitcore-node.

yemel avatar yemel commented on May 21, 2024

Remove custom headers at config/headers.js

res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,Content-Type,Authorization');
res.setHeader('Access-Control-Expose-Headers', 'X-Email-Needs-Validation,X-Quota-Per-Item,X-Quota-Items-Limit,X-RateLimit-Limit,X-RateLimit-Remaining');

from bitcore-node.

yemel avatar yemel commented on May 21, 2024

Remove currency on config/routes.js:

  // Currency
  var currency = require('../app/controllers/currency');
  app.get(apiPrefix + '/currency', currency.index);

Drop app/controllers/currency.js as well

from bitcore-node.

yemel avatar yemel commented on May 21, 2024

Remove default route on config/routes.js:

  app.get('*', index.render);

Remove associated code on app/controllers/index.js:

exports.render = function(req, res) {

  if (config.publicPath) {
    return res.sendfile(config.publicPath + '/index.html');
  }
  else {
    var version = _getVersion();
    res.send('bitcore-node API v' + version);
  }
};

from bitcore-node.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.