feat(BOOK-401): Add support for new-url -> new-url in the redirect-service * Switch to typescript * add new dependencies for tests and typescript * Switch to typescript * add new dependencies for tests and typescript * rewrite to typescript and include tests * rewrite to typescript and include tests * refactor: update README and scripts for CSV handling; rename update script to generate * include csv-data folder * feat(BOOK-401): Add support for new-url -> new-url in the redirect-service * Add errors when given unsupported URLs * merge Approved-by: Linus Flood
scandic-redirect
Netlify Function to handle redirect URLs for Current web -> New web during go live.
This function will be called by the web app's middleware to check if the incoming request contains a legacy URL that should be redirected.
The "source of truth" for which URLs should be redirected where will be provided by the SEO team and put in a JSON file within this app.
If no match for the incoming request is found, the request is passed on through the middleware.
Update the redirects from the source
The Excel source file used is located at:
- Open it
- Each domain/language has its own sheet
- Export each sheet into their respective language code
- File > Export > Download as CSV UTF-8
- Save as [lang].csv in
./scripts/data/csvfolder
- Run the
generatescript target- E.g.
yarn workspace @scandic-hotels/scandic-redirect generate
- E.g.
- Commit and push the JSON files in
./netlify/functions/data. - Create a PR
- Profit!