Last active
February 9, 2018 20:06
-
-
Save hanford/34a67e35ea88800907d671c7e51e2341 to your computer and use it in GitHub Desktop.
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
import Service, { Router } from '@eaze/service' | |
import { auth, isAdmin } from '@eaze/middleware' | |
class Acacia extends Service { | |
static router () { | |
return ( | |
<Router> | |
<Get route='/products' handler={(req, res) => res.send(200)} /> | |
<Post route='/products/create' middleware={[ isAdmin ]} handler={(req, res) => res.send(200)} /> | |
<Patch route='/products/:id' middleware={[ isAdmin ]} handler={(req, res) => res.send(200)} /> | |
<Get route='/products/:id' /> | |
</Router> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment