You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constvalidateImageUrl=async(url)=>{letisImage;// Fetching for checking for existance of resource and header Content-Type : image/*awaitfetch(url).then((response)=>{if(response.status===200&&((response.headers.raw()['content-type'][0]).match(/(image)+\//g)).length!=0){isImage=true;}else{isImage=false;}}).catch((error)=>{isImage=false;});// Requesting Size of the image just in case headers were wrongawaitrequestImageSize(url).then(size=>{isImage=true;}).catch(err=>{isImage=isImage||false;});returnisImage;}
💻 Code Examples - Frontend
Method to Edit a meme.
// Patching the memeresponse=awaitfetch(`/memes/${this.props.id}`,{method: "PATCH",headers: {"Content-Type": "application/json"},body: JSON.stringify({"url": this.state.url,"caption": this.state.caption})});
🆒 Features - Backend
All data stored in PostgreSQL database that can also be viewed and changed from the PostgreSQL shell (psql)
The Image URL is validated in the backend to avoid issues further.
Swagger UI runs on http://localhost:8080/swagger-ui/ in development and is extremely useful for testing and documenting the APIs.