Last active
February 20, 2018 08:02
-
-
Save charliewilco/2e44fe1d1ba23a8d6e36e0293a9df277 to your computer and use it in GitHub Desktop.
dumb idea
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const API = () => ( | |
<Endpoints> | |
<Get path='/posts' render={(req, res, props) => ( | |
<Mongoose schema={Post} find={req.params} /> | |
)} /> | |
<Post path='/posts' render={(req, res, props) => ( | |
<Mongoose schema={Post} add={req.params} /> | |
)} /> | |
<Get path='/posts/:id' render={(req, res, props) => ( | |
<Mongoose schema={Post} find={req.params.id} /> | |
)} /> | |
<Put path='/posts/:id' render={(req, res, props) => ( | |
<Mongoose | |
schema={Post} | |
update={req.params.id} | |
payload={req.payload} | |
/> | |
)} /> | |
<Delete path='/posts/:id' render={(req, res, props) => ( | |
<Mongoose | |
schema={Post} | |
remove={req.params.id} | |
/> | |
)} /> | |
</Endpoints> | |
) | |
const server = http.serve(<API />, 4000) | |
exports default server |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment