You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use your middleware. When I start my server and go to localhost:3000/cors-anywhere, I would expect to see the cors-anywhere text, but I get this:
Error: connect ECONNREFUSED 127.0.0.1:80
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14)
My code is simply:
importexpressfrom'express';importcorsfrom'cors';importanywherefrom'express-cors-anywhere';importpathfrom'path';const{PORT}=process.env;constport=PORT||3030;varapp=express();app.use(cors());app.use('/cors-anywhere',anywhere());app.get('*',(req,res)=>{console.log('gotten');res.sendFile(path.resolve(__dirname,'index.html'));});app.listen(port,()=>{console.log(`App listening on port ${port}`);});
I get the same error when I use the example code from your readme:
importexpressfrom"express";importaxiosfrom"axios";import{json}from"body-parser";importanywherefrom"express-cors-anywhere";const{PORT}=process.env;constport=PORT||3000;(async()=>{/* configure cors */awaitnewPromise(resolve=>express().use(json()).use("/cors-anywhere",anywhere()).get("/hello",(_,res)=>res.status(200).send("Hi!")).listen(port,resolve),);})();
Is this error expected?
The text was updated successfully, but these errors were encountered:
I am trying to use your middleware. When I start my server and go to localhost:3000/cors-anywhere, I would expect to see the cors-anywhere text, but I get this:
My code is simply:
I get the same error when I use the example code from your readme:
Is this error expected?
The text was updated successfully, but these errors were encountered: