Create a Reverse proxy server in NodeJS which should serve static site
Attendee should be able to implement reverse proxy in Nodejs. Reverse proxy shold able to serve static site. Proxy should handle the HTML Push state too.
- Should serve static site
- Handle HTML Push state (should handle 404 on hard refresh for virtual path)
- Should be able to implement custom redirects
- Should be able to implement custom rewrites
- Should be able to implement custom headers
- Should accept rewrites, redirects and header rules from a config file
- Proxy should accept the static site directory
- Proxy should be able to implement CleanURLS
Proxy will be tested against following static site framework
- ReactJS (Create react app)
- Hugo
- Plain html
- AngularJS
{
"redirects": [
{ "source": "/old-docs/:id", "destination": "/new-docs/:id" },
{ "source": "/old", "destination": "/new", "type": 302 }
],
"rewrites" : [
{ "source": "app/**", "destination": "/index.html" },
{ "source": "projects/*/edit", "destination": "/edit-project.html" }
],
"cleanUrls": false,
"dir": "/path/to/your/_site"
}