I'm updating some routes in my app which will obviously break some existing clients so I want to do the right thing and have the old routes there as a 'forward' from the old route to the new one. Is there a method of specifying the old route something like:
val routes = path("new" / "route" / Segment) { id =>
get {
complete(s"$id")
}
} ~ path("old" / "route" / Segment) { id =>
get {
forward(s"new/route/$id")
}
}
...so a request to both of these would work:
I can find a redirect but I'd rather have this happen under the hood inside Spray rather than do a hard redirect of the client, if it's possible?
Thanks!