@requestly/mock-server
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -23,9 +23,2 @@ "use strict"; | ||
const app = (0, express_1.default)(); | ||
app.use((0, cors_1.default)({ | ||
origin: true, | ||
exposedHeaders: "*", | ||
credentials: true, | ||
preflightContinue: true, | ||
optionsSuccessStatus: 200, | ||
})); | ||
app.use((_, res, next) => { | ||
@@ -38,7 +31,10 @@ res.set({ | ||
}); | ||
// ends the options requests without sending anything | ||
const optionsRegex = new RegExp(`${pathPrefix}\/(.+)`); | ||
app.options(optionsRegex, (_, res) => { | ||
res.end(); | ||
}); | ||
app.use((0, cors_1.default)({ | ||
origin: true, | ||
exposedHeaders: "*", | ||
methods: "*", | ||
credentials: true, | ||
preflightContinue: false, | ||
optionsSuccessStatus: 200, | ||
})); | ||
// pathPrefix to handle /mockv2 prefix in cloud functions | ||
@@ -45,0 +41,0 @@ const regex = new RegExp(`${pathPrefix}\/(.+)`); |
{ | ||
"name": "@requestly/mock-server", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "- Methods: GET, POST, PUT, OPTIONS - Description - Endpoint (can be full path) (/api/v1/users) - Multiple Responses - Shuffle Response - Sequential Response - Rules in Response - Status (Any status code 2xx, 4xx) - Latency - Body - Templating - Faker js - Headers", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
23402
543