Skip to content

mikelu94/express

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Express

Some express projects that I wrote.

Dependencies:

  • docker

How to Set Up

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']
    }
  }
};

About

express projects

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published