Comments (1)
If it's purely a server side check on intitial page load then you can do the check in server.ts
- on line 60, you chould check req.cookies
and the corresponding path, and do any auth you need there. This is just a simple express server, so you can theoretically do whatever you'd like.
This isn't a replacement for nextjs. Truth be told you should probably just use nextjs - it's gotten to a fairly mature point, and a boilerplate like this is only interesting if you absolutely must have a stateful server, for some reason.
from vite-typescript-ssr-react.
Related Issues (15)
- [Bug] [Error: ENOENT: no such file or directory, scandir] HOT 8
- How to deploy this app with vercel or netlify configuration? HOT 2
- Encountered “Minified React error” in the production environment HOT 1
- Crash on start yarn dev:server HOT 2
- Update head tags using Helmet HOT 1
- Vite React MUI SSR Error - Expected server HTML to contain a matching <div> in <div> HOT 1
- I meet a problem HOT 3
- Could not find a declaration file for module 'serve-static'. HOT 1
- Running without ts-node? HOT 1
- Failed to load asset when serving HOT 2
- Error on production HOT 1
- Dev dependecies in Docker
- dist/src/server/routes/api not found HOT 5
- SSR does not trigger page reload when change HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vite-typescript-ssr-react.