forked from sf-wdi-22-23/toEatly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
28 lines (24 loc) · 762 Bytes
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// SERVER-SIDE JAVASCRIPT
// REQUIREMENTS //
var express = require("express"),
app = express(),
path = require("path"),
bodyParser = require("body-parser");
// CONFIG //
// set ejs as view engine
app.set('view engine', 'ejs');
// serve js & css files
app.use("/static", express.static("public"));
// body parser config to accept our datatypes
app.use(bodyParser.urlencoded({ extended: true }));
// DATA //
var foods =[
{id: 0, name: "Sushiritto", yumminess: "quite"},
{id: 1, name: "Green Eggs & Ham", yumminess: "sure"},
{id: 2, name: "Crayfish", yumminess: "depending"},
{id: 3, name: "Foie Gras", yumminess: "omg"},
{id: 4, name: "Kale", yumminess: "meh"}
];
app.listen(3000, function (){
console.log("listening on port 3000");
});