- You are asked to build an API for a photo app.
- You need to create the routes according to REST for the following actions:
- The end-user wants to see a list of photos
GET /photos
- The end-user wants to see a particular photo
| const movies = [ | |
| { title: 'Black Panther', year: 2018, genre: 'action', rating: 7.4 }, | |
| { title: 'Avengers Infinity War', year: 2018, genre: 'action', rating: 8.5 }, | |
| { | |
| title: 'Spider-Man: Into the Spider-Verse', | |
| year: 2018, | |
| genre: 'Fantasy/Science Fiction', | |
| rating: 8.7 | |
| }, | |
| { |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <title>Results</title> | |
| <link rel="stylesheet" href="/vendor/normalize-4.1.1.css" type="text/css" /> | |
| <link rel="stylesheet" href="/vendor/border-box.css" type="text/css" /> | |
| <link rel="stylesheet" href="/styles/layout.css" type="text/css" /> | |
| <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> | |
| <script type="text/javascript" src="/vendor/jquery-3.0.0.js"></script> |
| // Array Destructuring | |
| // Destructuring the array the conventional way | |
| const anArray = [1, 2, 3]; | |
| const a = anArray[0]; | |
| const b = anArray[1]; | |
| const c = anArray[2]; | |
| // With ES6 Destructuring |
| // Array Destructuring | |
| // Destructuring the array the conventional way | |
| const anArray = [1, 2, 3]; | |
| const a = anArray[0]; | |
| const b = anArray[1]; | |
| const c = anArray[2]; | |
| // With ES6 Destructuring |
| $(document).ready(function() { | |
| var cityName = 'Montreal'; | |
| var apiKey = 'put your api key here'; | |
| var url = | |
| 'https://api.openweathermap.org/data/2.5/weather?q=' + | |
| cityName + | |
| '&appid=' + | |
| apiKey; |
| const ancestry = [ | |
| {"name": "Emma de Milliano", "sex": "f", | |
| "born": 1876, "died": 1956, | |
| "father": "Petrus de Milliano", | |
| "mother": "Sophia van Damme"}, | |
| {"name": "Carolus Haverbeke", "sex": "m", | |
| "born": 1832, "died": 1905, | |
| "father": "Carel Haverbeke", | |
| "mother": "Maria van Brussel"}, | |
| {"name": "Marcus Pillus", "sex": "m", |