diff options
| author | Mike Vink <mike1994vink@gmail.com> | 2021-06-03 10:45:37 +0200 |
|---|---|---|
| committer | Mike Vink <mike1994vink@gmail.com> | 2021-06-03 10:45:37 +0200 |
| commit | 0114244663fbb8cd45a7cc4489bda469b31f0698 (patch) | |
| tree | 0b4836e947cbbb1514143cb76cd85b050a586277 /main.js | |
| parent | 798101f8fa2c5e3a0cdb5fbbbb053976bce96c63 (diff) | |
shoppingbasket implementatie
Diffstat (limited to 'main.js')
| -rw-r--r-- | main.js | 34 |
1 files changed, 17 insertions, 17 deletions
@@ -1,11 +1,11 @@ /** * Server side code using the express framework running on a Node.js server. - * + * * Load the express framework and create an app. */ const express = require('express'); const app = express(); -/** +/** * Host all files in the client folder as static resources. * That means: localhost:8080/someFileName.js corresponds to client/someFileName.js. */ @@ -20,7 +20,7 @@ app.use(express.json()); * Our code starts here. */ const attractions = [ - { + { name: "De Efteling", description: "The Dutch fairy tale themed park. In high demand!", adultPrice: 32, @@ -32,7 +32,7 @@ const attractions = [ location: { lat: 51.649718, lon: 5.043689 }, }, - { + { name: "Madurodam", description: "The Netherlands smallest theme park.", adultPrice: 25, @@ -44,7 +44,7 @@ const attractions = [ location: { lat: 52.0994779, lon: 4.299619900000039 }, }, - { + { name: "Toverland", description: "Experience magic and wonder.", adultPrice: 30, @@ -56,7 +56,7 @@ const attractions = [ location: { lat: 51.3968994, lon: 5.9825161 }, }, - { + { name: "Walibi Holland", description: "Need an Adrenaline Rush?", adultPrice: 37, @@ -67,8 +67,8 @@ const attractions = [ available: 20, location: { lat: 52.438554, lon: 5.766986 }, }, - - { + + { name: "Duinrell", description: "From the Kikkerbaan to the Tikibad.", adultPrice: 22, @@ -78,9 +78,9 @@ const attractions = [ discount: 7, available: 20, location: { lat: 52.147433, lon: 4.383922 }, - }, + }, - { + { name: "Slagharen", description: "Fun for the whole family in a true western style.", adultPrice: 28, @@ -90,9 +90,9 @@ const attractions = [ discount: 50, available: 2, location: { lat: 52.6249522, lon: 6.563149500000009 }, - }, + }, - { + { name: "Drievliet", description: "Come and experience our wonderful attractions.", adultPrice: 26, @@ -102,18 +102,18 @@ const attractions = [ discount: 25, available: 0, location: { lat: 52.052608, lon: 4.352633 }, - }, + }, ] /** * A route is like a method call. It has a name, some parameters and some return value. - * + * * Name: /api/attractions * Parameters: the request as made by the browser * Return value: the list of attractions defined above as JSON - * + * * In addition to this, it has a HTTP method: GET, POST, PUT, DELETE - * + * * Whenever we make a request to our server, * the Express framework will call one of the methods defined here. * These are just regular functions. You can edit, expand or rewrite the code here as needed. @@ -151,4 +151,4 @@ app.get("/api/admin/edit", function (request, response) { * Make our webserver available on port 8000. * Visit localhost:8000 in any browser to see your site! */ -app.listen(8000, () => console.log('Example app listening on port 8000!'));
\ No newline at end of file +app.listen(8000, () => console.log('Example app listening on port 8000!')); |
