Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 6144

The request works using cURL, but doesn't work in Postman and browser

$
0
0

Node Js (express) server responds to requests via cUrl, but gives infinite load when requested via Postman or browser. There are no errorsFound similar tracks, but none of them helped me.Can you tell me what this might be related to?

Express js

const app = express();app.use(cors());app.use(express.json());app.use(express.static(path.resolve(__dirname, 'static')))app.use(fileUpload({}))app.use('/api', router)app.use(errorHandler)const start = async () => {    try {        await sequelize.authenticate();        await sequelize.sync();        app.listen(PORT, () => {            console.log(`Server started on port ${PORT}`);        });    } catch (e) {        console.log(e);    }};start();//curl request (Empty array response, because bd is empty)root@fnrnacxqna:~# curl http://5.35.95.237:5000/api/client[]root@fnrnacxqna:~#// server reaction (Pretty sure this is useless information, but still)Executing (default): SELECT "id", "name", "img", "createdAt", "updatedAt" FROM "clients" AS "client"; //connection checkroot@fnrnacxqna:~# sudo lsof -i -P -n | grep LISTENsystemd-r  3733 systemd-resolve   14u  IPv4  35965      0t0  TCP 127.0.0.53:53 (LISTEN)sshd      13689            root    3u  IPv4  44183      0t0  TCP *:22 (LISTEN)sshd      13689            root    4u  IPv6  44194      0t0  TCP *:22 (LISTEN)nginx     25349            root    6u  IPv4  88138      0t0  TCP *:80 (LISTEN)nginx     25349            root    7u  IPv6  88139      0t0  TCP *:80 (LISTEN)nginx     25350        www-data    6u  IPv4  88138      0t0  TCP *:80 (LISTEN)nginx     25350        www-data    7u  IPv6  88139      0t0  TCP *:80 (LISTEN)postgres  31592        postgres    5u  IPv4 128205      0t0  TCP *:5432 (LISTEN)postgres  31592        postgres    6u  IPv6 128206      0t0  TCP *:5432 (LISTEN)node      33352            root   24u  IPv6 139994      0t0  TCP *:5000 (LISTEN)root@fnrnacxqna:~#

Following advice from other posts, tried changing the Postman settings, but nothing helped.


Viewing all articles
Browse latest Browse all 6144

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>