Skip to content

Instantly share code, notes, and snippets.

@azamsharp
Created May 14, 2020 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azamsharp/ca94c30e8161bbafbb38c6a1a44fd647 to your computer and use it in GitHub Desktop.
Save azamsharp/ca94c30e8161bbafbb38c6a1a44fd647 to your computer and use it in GitHub Desktop.
// REVIEW ACTIVITY 1 - COUNTER - START
app.get('/counter',(req,res) => {
res.render('counter',{counter: req.session.counter})
})
app.post('/update-counter',(req,res) => {
if(req.session) {
req.session.counter += 1
res.redirect('/counter')
}
})
// REVIEW ACTIVITY 1 - COUNTER - END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment