arbassic / ts-sequelize-example Goto Github PK
View Code? Open in Web Editor NEWNode.js + Express + TypeScript + Sequelize v5 + Session + Basic CRUD Boilerplate
Node.js + Express + TypeScript + Sequelize v5 + Session + Basic CRUD Boilerplate
Hi @arbassic , thank you for publishing your example.
I am working with node/typescript and express
I looked up desperately google and github, to find a way to read/write data to my http session (I am using package express-session
, like you and many) :
console.log(req.session)
, I see data like :---------------------------------------
Express Session is :
Session {
cookie: { path: '/', _expires: null, originalMaxAge: null, httpOnly: true },
passport: {
user: {
github_profile: [Object],
github_access_token: '9838d3c2a8817e393fa673d43f70b602b2a9bdc8'
}
}
}
---------------------------------------
^C
jbl@poste-devops-jbl-16gbram:~/hugo-cheatsheet$ tsc
src/server/permissions/pokus/github/index.ts:29:31 - error TS2339: Property 'passport' does not exist on type 'Session & Partial<SessionData>'.
29 console.log(req.session.passport)
~~~~~~~~
Found 1 error.
TypeScript
, as you can see, If I try to req.session.passport
or req.session["passport"]
, then my compiler of course gives me an error...tsconfig.json
than you in my project! .... This is killing me ...Here is my source code :
Would you have any tip on how to do that ..?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.