Last active
September 9, 2019 21:07
-
-
Save dgieselaar/f2a304b4284d33f9731a2c2a2f89c3c1 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
const route = createRoute({ | |
url: '/api/metrics/:type', | |
method: 'GET', | |
params: { | |
path: t.type({ | |
type: t.string | |
}), | |
query: t.type({ | |
start: t.string, | |
end: t.string | |
}) | |
}, | |
handler: ( request ) => { | |
const { type } = request.params; | |
const { start, end } = request.query; | |
return getMetrics({ type, start, end }); | |
} | |
}); | |
server.route(route); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment