let express = require("express")
let ourApp = express()
ourApp.get("/", function(req, res) {
res.send(`
<form action='/answer' method='POST'>
<p>What color is the sky on a clear and sunny day?</p>
<input name="skyColor" autocomplete="off">
<button>Submit Answer</button>
</form>
`)
})
ourApp.post('/answer', function(req, res) {
if(req.body.skyColor == "BLUE") {
res.send(`
<p>Congrats! You got the right answer.</p>
<a href="/">Back to homepage</a>
`)
} else {
res.send(`
<p>Sorry, you got the wrond answer. Please try again</p>
<a href="/">Back to homepage</a>
`)
}
})
ourApp.get('/answer', function(req, res) {
res.send("Are you lost? There is nothing to see here.")
})
ourApp.listen(3000)
It keeps telling me
TypeError: Cannot read property 'skyBlue' of undefined.
I'm new to node and express so any help would be appreciated