Skip to content

RestRserve router end point as a module #203

Discussion options

You must be logged in to vote

I was able to make something work, but I feel this is a hack. I would appreciate input from the developers of RestRserve for an official way of creating these modules, @dselivanov.

I would like to see the ability to create a Router and import that into Application. I will continue reading the source code to see if I can find any better way.

main.R

#!/usr/bin/env Rscript
box::use(RestRserve)

app <- RestRserve$Application$new()

box::use(./user_routes/index[ user_routes ])

user_routes(app)

backend <- RestRserve$BackendRserve$new()
backend$start(app, http_port = 8080)

user_routes/index.R

box::use(RestRserve)

box::use(./user_route_1[ user_route_1 ])
box::use(./user_route_2[ user_route_2 ])

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dereckmezquita
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant