Skip to content

Commit

Permalink
add url rewrite to handle campaigns
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgeniy Rotar committed Jan 24, 2019
1 parent 8d28a54 commit 8ce45be
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
4 changes: 2 additions & 2 deletions packages/sitecore-jss-proxy/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 6 additions & 12 deletions packages/sitecore-jss-proxy/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@sitecore-jss/sitecore-jss-proxy",
"version": "11.0.2",
"description": "Proxy middleware for express.js server.",
"name": "@weareyou/sitecore-jss-proxy",
"version": "2.0.0",
"description": "Proxy middleware for express.js server with support query params in layoutService.",
"main": "dist/index.js",
"scripts": {
"build": "npm run clean && tsc",
Expand All @@ -15,14 +15,9 @@
"node": ">=8.1"
},
"author": {
"name": "Sitecore Corporation",
"url": "https://jss.sitecore.net"
"name": "Evgeniy Rotar"
},
"license": "Apache-2.0",
"homepage": "https://jss.sitecore.net",
"bugs": {
"url": "https://github.com/sitecore/jss/issues"
},
"dependencies": {
"http-proxy-middleware": "^0.19.0",
"set-cookie-parser": "^2.2.1"
Expand All @@ -40,6 +35,5 @@
"ts-node": "^7.0.1",
"typescript": "^3.1.3"
},
"types": "types/index.d.ts",
"gitHead": "f3c6b5d6bd7118f0736011f20efb9e0ae2d61ff5"
}
"types": "types/index.d.ts"
}
4 changes: 2 additions & 2 deletions packages/sitecore-jss-proxy/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ async function renderAppToResponse(
}

// we are going to set our own status code if rendering fails
serverResponse.writeHead = () => {};
serverResponse.writeHead = () => { };

// buffer the response body as it is written for later processing
let buf = Buffer.from('');
Expand Down Expand Up @@ -345,7 +345,7 @@ export function rewriteRequestPath(
if (config.debug) {
console.log(`DEBUG: Parsing route URL using ${decodedReqPath} URL...`);
}
const routeParams = parseRouteUrl(decodedReqPath);
const routeParams = parseRouteUrl(finalReqPath);

if (routeParams) {
if (routeParams.sitecoreRoute) {
Expand Down

0 comments on commit 8ce45be

Please sign in to comment.