Skip to content

Instantly share code, notes, and snippets.

@hanford
Last active February 9, 2018 20:06
Show Gist options
  • Save hanford/34a67e35ea88800907d671c7e51e2341 to your computer and use it in GitHub Desktop.
Save hanford/34a67e35ea88800907d671c7e51e2341 to your computer and use it in GitHub Desktop.
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