Skip to content

Instantly share code, notes, and snippets.

View ghawthorne66's full-sized avatar
🎯
Focusing

Greg Hawthorne ghawthorne66

🎯
Focusing
View GitHub Profile
@ghawthorne66
ghawthorne66 / gist:4eb119f6233adb5a0d03f6e3867ff98d
Last active August 15, 2021 09:26
nuxt remove trailing slashes /
//Create src/middleware/trailingSlashRedirect.js//
export default function ({ route, redirect }) {
if (route.path !== '/' && route.path.endsWith('/')) {
const { path, query, hash } = route;
const nextPath = path.replace(/\/+$/, '') || '/';
const nextRoute = { path: nextPath, query, hash };
redirect(nextRoute);
}
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json