Home > Software design >  what is Postman's port?
what is Postman's port?

Time:09-26

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.

CodePudding user response:

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.

  • Related