Some express projects that I wrote.
- docker
For any of these projects, just run:
$ docker-compose up
and
$ docker-compose down
For passport
, you need to add an additional passport/config.js
:
module.exports = {
oauth: {
google: {
clientID: "GOOGLE CLIENT ID HERE",
clientSecret: "GOOGLE CLIENT SECRET HERE",
serviceName: "Google"
},
facebook: {
clientID: "FACEBOOK CLIENT ID HERE",
clientSecret: "FACEBOOK CLIENT SECRET HERE",
serviceName: "Facebook"
}
},
cookieSessionKeys: ['express/passport cookie session key']
}
For jwt
, you need to add an additional jwt/config.js
:
const maxAgeSeconds = 60 * 60;
module.exports = {
cookie: {
loginOptions: {
httpOnly: true,
maxAge: maxAgeSeconds * 1000
},
logoutOptions: {
maxAge: 0
}
},
jwt: {
secretOrPrivateKey: 'RSA PRIVATE KEY HERE',
signOptions: {
algorithm: 'RS256',
expiresIn: maxAgeSeconds
},
verifyOptions: {
algorithms: ['RS256']
}
}
};