Closed felixheck closed 5 years ago
Alternatively I would like to "override" the self
link with a custom one.
If I do so at the moment, the self
become an array :/
@bleupen There won't be a feature like that in the near future or will it? Just wanna know because of a new project :)
You can set it in the prepare function. Will this work for you?
server.route({
method: 'get',
path: '/hello/{name}',
config: {
handler: function (req, reply) {
reply({ message: 'Hello, ' + req.params.name });
},
plugins: {
hal: {
prepare: function (rep, done) {
rep._links.self.href = '/foo/bar';
done();
}
}
}
}
});
Hi there!
I am currently looking for an approach to customize the
_self
link. On the one hand I want, that all query parameters of the request will be appended. I do not wanna define them explicitly. Is there a possible and smart way with halacious?On the other hand I want to strip query parameters depending on their value. For example
page=1
should be stripped because1
is the default ofpage
. Is there a way to define a custom link generator? This would solve perhaps the first issue too.Nevertheless thanks for your work, I love the Plugin :)