Replies: 1 comment
-
I solved the problem, maybe it will be useful to someone. import express from 'express';
import { handler as ssrHandler } from './dist/server/entry.mjs';
const app = express();
app.use(express.static('dist/client/'));
// Slash ekleyerek yönlendirme
app.use((req, res, next) => {
const hasDotOrUnderscore = req.path.includes('.') || req.path.includes('_') || req.path.includes();
if (!req.path.endsWith('/') && !hasDotOrUnderscore) {
return res.redirect(301, `${req.path}/`);
}
next();
});
app.use(ssrHandler);
// Sunucuyu dinlemeye başla
app.listen(4321, () => {
console.log('Server is running on http://localhost:4321');
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Body
Trailingslash works on static files, but it doesn't work on ssr files? What is the reason?
Beta Was this translation helpful? Give feedback.
All reactions