function create(recipeInfo) {
    // Creation fetch
    // Unlike other fetches, headers also requires content type
    // Because no photos are added, content type can be json application
    return fetch(BASE_URL, {
        method: 'POST',
        body: JSON.stringify(recipeInfo),
        headers: new Headers ({'Content-Type': 'application/json', 'Authorization': 'Bearer ' + tokenService.getToken()})
    }).then(res => {
        // If valid (return code 2xx) return
        // Otherwise throw an error
        if (res.ok) return res.json();
        throw new Error ('Error submitting, check express terminal')
    })
}
// Authorization path for creating a recipe

Authorization path for creating a recipe
Authorization path for creating a recipe
function create(recipeInfo) {
    return fetch(BASE_URL, {
        method: 'POST',
        body: JSON.stringify(recipeInfo),
        headers: new Headers ({'Content-Type': 'application/json', 'Authorization': 'Bearer ' + tokenService.getToken()})
    }).then(res => {
        if (res.ok) return res.json();
        throw new Error ('Error submitting, check express terminal')
    })
}
function create ( recipeInfo ) { return fetch ( BASE_URL , { method : 'POST' , body : JSON . stringify ( recipeInfo ) , headers : new Headers ( { 'Content-Type' : 'application/json' , 'Authorization' : 'Bearer ' + tokenService . getToken ( ) } ) } ) . then ( res => { if ( res . ok ) return res . json ( ) ; throw new Error ( 'Error submitting, check express terminal' ) } ) }
Authorization path for creating a recipe
Authorization path for creating a recipe
// Creation fetch
 // Unlike other fetches, headers also requires content type
 // Because no photos are added, content type can be json application
 // If valid (return code 2xx) return
 // Otherwise throw an error
