Creating sample JSON data

Let's create the sample movies.json file that will act as our temporary data store (even though the API we build for the purpose of demonstration won't actually persist data beyond the app's life cycle):

[{ 
    "Id": "1", 
    "Title": "Aliens", 
    "Director": "James Cameron", 
    "Year": "1986", 
    "Rating": "8.5" 
}, 
{ 
    "Id": "2", 
    "Title": "Big Trouble in Little China", 
    "Director": "John Carpenter", 
    "Year": "1986", 
    "Rating": "7.3" 
}, 
{ 
    "Id": "3", 
    "Title": "Killer Klowns from Outer Space", 
    "Director": "Stephen Chiodo", 
    "Year": "1988", 
    "Rating": "6.0" 
}, 
{ 
    "Id": "4", 
    "Title": "Heat", 
    "Director": "Michael Mann", 
    "Year": "1995", 
    "Rating": "8.3" 
}, 
{ 
    "Id": "5", 
    "Title": "The Raid: Redemption", 
    "Director": "Gareth Evans", 
    "Year": "2011", 
    "Rating": "7.6" 
}] 

This is just a really simple JSON list of a few of my favorite movies. Feel free to populate it with whatever you like. Boot up the server to make sure you aren't getting any errors (note that we haven't set up any routes yet, so it won't actually do anything if you try to load it via a browser):

    $ node server.js
    Server up: http://localhost:3500
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.63.95