Name: Dovid Baum
Date: 06/11/2019
Project Topic:
URL:
Data point fields:
Field 1: titleType: StringField 2: authorType: StringField 3: ratingType: NumberField 4: descriptionType: StringField 5: imageType:fileField 6: ratingsType:[Number]Field 7: timeType:String
Schema:
{"podcasts":[
{"title":"asdasd",
"author":"asdasd",
"rating":"",
"description":"<p>dsfad</p>\n",
"image":"f9ca3a0de2ed710dc09f2fbf9a726190",
"ratings":[null],"time":"2019-04-11T17:50:51-04:00"}
]}note: I gave HTML form route and POST endpoint route same path, they both work when tested
HTML form route: /create
POST endpoint route: /create
Example Node.js POST request to endpoint:
var request = require("request");
var options = {
method: 'POST',
url: 'http://localhost:3000/create',
headers: {
'content-type': 'application/x-www-form-urlencoded'
},
form: {
title: 'Postman Podcast',
author: 'Postman Author',
image: "http://i.imgur.com/iGLcfkN.jpg",
rating: 1.3,
description: 'Incredible podcast about Postman'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
}); GET endpoint route: /getPodcasts
Search Field: title
Navigation Filters
- Heavy Dogs ->
/heaviest - Select a Breed ->
/breed/:breed_name - Young Dog ->
/youngest - Random Dog ->
/random - Alphabetical Dogs ->
/alphabetical