🍕🌟 Checkpoint
./views/index.html:96831/368 ./public/style.css:96831/36 ./server.js:96831/437
This commit is contained in:
1 parent
12f2f5e223
commit
406fcf36d0
5 files changed
+52
-105
No files matched your search
@@ -16,23 +16,6 @@ app.get("/", function (request, response) {
|
||||
response.sendFile(__dirname + '/views/index.html');
|
||||
});
|
||||
|
||||
app.get("/dreams", function (request, response) {
|
||||
response.send(dreams);
|
||||
});
|
||||
|
||||
// could also use the POST body instead of query string: http://expressjs.com/en/api.html#req.body
|
||||
app.post("/dreams", function (request, response) {
|
||||
dreams.push(request.query.dream);
|
||||
response.sendStatus(200);
|
||||
});
|
||||
|
||||
// Simple in-memory store for now
|
||||
var dreams = [
|
||||
"Find and count some sheep",
|
||||
"Climb a really tall mountain",
|
||||
"Wash the dishes"
|
||||
];
|
||||
|
||||
// listen for requests :)
|
||||
var listener = app.listen(process.env.PORT, function () {
|
||||
console.log('Your app is listening on port ' + listener.address().port);
|
||||
|
||||
Reference in new issue
Block a user