Skip to content

Instantly share code, notes, and snippets.

@heytulsiprasad
Last active July 15, 2020 20:55
Show Gist options
  • Select an option

  • Save heytulsiprasad/e5887de96196f88d879e778ca4d174ae to your computer and use it in GitHub Desktop.

Select an option

Save heytulsiprasad/e5887de96196f88d879e778ca4d174ae to your computer and use it in GitHub Desktop.
Travel Log application

Setup a Eslint config file

npx eslint --init

Common essential middlewares

  • Morgan: helps in logging server requests (dev and prod)
  • Helmet: removes unnecessary default server response and adds useful (most) secure headers
  • Cors: good ol' cors, allows access to make server requests
app.use(morgan("common"))
app.use(helmet())
app.use(cors({ origin: 'http://localhost:4002' }))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment