Skip to content

Instantly share code, notes, and snippets.

@jordanwalsh23
Last active June 20, 2024 07:12
Show Gist options
  • Select an option

  • Save jordanwalsh23/40243d5f9837a2e01cab0b75cd4ea1f4 to your computer and use it in GitHub Desktop.

Select an option

Save jordanwalsh23/40243d5f9837a2e01cab0b75cd4ea1f4 to your computer and use it in GitHub Desktop.
Run a Postman Mock Server on Localhost
const PostmanLocalMockServer = require('@jordanwalsh23/postman-local-mock-server');
const fs = require("fs");
const PORT = process.env.PORT || 3002;
//Create the collection object.
let collection = JSON.parse(fs.readFileSync('./collection.json', 'utf8'));
//Create a new server
let server = new PostmanLocalMockServer(PORT, collection);
//Start the server
server.start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment