I’ve cheked your code on a clean ExpressJS app and it works just fine.
Try move your app.use(allowCrossDomain)
to the top of configure function.
More Related Contents:
- No ‘Access-Control-Allow-Origin’ – Node / Apache Port Issue
- Why doesn’t adding CORS headers to an OPTIONS route allow browsers to access my API?
- Can I use a file based database on Heroku?
- How to enable cross-origin resource sharing (CORS) in the express.js framework on node.js
- Setting the port for node.js server on Heroku
- First Heroku deploy failed `error code=H10`
- How to implement a secure REST API with node.js
- TypeError: db.collection is not a function
- Deploy Nodejs on Heroku fails serving static files located in subfolders
- Access to XMLHttpRequest at ‘…’ from origin ‘localhost:3000’ has been blocked by CORS policy
- Getting express server to accept CORS request
- CORS-enabled server not denying requests
- npm ERR cb() never called
- Difference between app.use and app.get in express.js
- MongoDB/Mongoose querying at a specific date?
- What is the parameter “next” used for in Express?
- npm can’t find package.json
- Get hostname of current request in node.js Express
- passport.js passport.initialize() middleware not in use
- Error: getaddrinfo ENOTFOUND in nodejs for get call
- Enable Access-Control-Allow-Origin for multiple domains in Node.js [duplicate]
- Catch all uncaughtException for Node js app
- Connecting Heroku App to Atlas MongoDB Cloud service
- ENOENT: no such file or directory .?
- Difference between `npm start` & `node app.js`, when starting app?
- How can I get Express.js to 404 only on missing routes?
- How to use socket.io in express routes?
- Express Router undefined params with router.use when split across files
- Connect or Express middleware to modify the response.body [closed]
- Using multiple parameters in URL in express