Handlebars.js is the worst templating language in existence, but, if you have to use it, and need some sort of "global" value in your templates, e.g., a csrf_token, then you can use this:
Just had the most annoying bug to debug in an Express App. I’d included the cors middleware, but had done:
app.use(cors)
instead of:
app.use(cors())
so requests just hung indefinitely. Took me a good 30-60 minutes to debug, because I'd changed a bunch of other code that could’ve been interacting badly.
Starting on a rewrite of an internal tool for a client, but trying to decide on which stack to use. The previous developer is versed in Vue/express and is able to help me out if I went that route. However, I've gotten a taste of sveltekit and love it because I can combine the frontend and API pretty seamlessly. Its problems are twofold though:
The previous dev would be significantly less help
Sveltekit is very new, meaning it is constantly changing and has a smaller, though more invested ecosystem (libraries, community, etc.)
I'm leaning towards Vue/Express right now, but I'm still not sure..
For session handling, I'm gonna use cookie-session in httpOnly mode, so @nosherwan will be happy. A guard will validate user roles from the cookie data. The data will be set at login and destroyed at logout.
After several days of working on my #MagicMirror, which is now working as intended, I went back to day 48 of #100DaysOfCode#WebDev. Today was an introduction to #ExpressJS, and the course is running pretty fast now. I really like it, especially because it allows me to play around more and do more useful things with #JavaScript. But on the other hand, I feel I need to repeat a few course sections.