portfolio . linkedin . stackoverflow . codepen . dev.to
am-77 / deno-rest-api Goto Github PK
View Code? Open in Web Editor NEW๐ฆ A rest API made with Deno
๐ฆ A rest API made with Deno
portfolio . linkedin . stackoverflow . codepen . dev.to
Line 29 in 79116d9
response.body = book
Line 38 in 5fef8ea
Otherwise body.value
will be Promise { <pending> }
at that point.
Same error in the updateBook
function.
Line 38 in 5fef8ea
Given there already is an interface IBook
defining how a book should look like, is there an easy way to check that body.value
matches with that interface? I'm asking that question because with the current code I'm able to post any kind of data:
$ curl -H "Content-type: application/json" -X POST http://localhost:7700/books/ -d '{"foo": "bar"}'
{"message":"OK"}
$ curl -X GET http://localhost:7700/books | jq
[
{
"isbn": "1",
"author": "Robin Wieruch",
"title": "The Road to React"
},
{
"isbn": "2",
"author": "Kyle Simpson",
"title": "You Don't Know JS: Scope & Closures"
},
{
"isbn": "3",
"author": "Andreas A. Antonopoulos",
"title": "Mastering Bitcoin"
},
{
"foo": "bar"
}
]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.