Reputation: 2078
I have encountered server.inject in test examples, but not in production code example.
I have a route that needs to execute something that is handled by another route, so I need to make an internal call.
handler: (req, res) => {
const OPTIONS = {
method: 'POST',
path: '/path'
payload: {PAYLOAD_HERE}
}
server.inject(OPTIONS, (err, response) => {
res(response)
});
}
is this okay?
Upvotes: 0
Views: 439