Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

what is Postman's port?

in my index.js file I have

const express = require("express");
const app = express();
require("dotenv").config();
var cors = require("cors");

app.use(
  cors({
    origin: ["localhost:2200", "localhost:2201"],
  })
);

In addition to the origins defined above, I need to add the origin for postman for testing and development.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Postman does not have an origin (it’s not a browser and isn’t running in a webpage that would determine the origin) and does not implement CORS so you don’t have to worry about it for requests coming from Postman.

CORS is something only implemented in a browser and restricts access to some requests from within a webpage. It’s the browser that implements that restriction. When testing from Postman, there will be no CORS restrictions.

what is Postman’s port?

Since it has no origin and doesn’t implement CORS, there is no associated port.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading