Skip to content

Serving TW5 in existing NodeJS application #8006

Answered by Jermolene
Keyholder asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Keyholder if you want to experiment with re-using the route handlers, you can get a reference to them with the following code:

$tw.modules.forEachModuleOfType("route", function(title,routeDefinition) {
	console.log(routeDefinition);
});

You'd need to fake a "state" object to pass to the route handlers along with the request and response objects.

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
5 replies
@Keyholder
Comment options

@Jermolene
Comment options

@Keyholder
Comment options

@Jermolene
Comment options

Answer selected by Keyholder
@Keyholder
Comment options

Comment options

You must be logged in to vote
1 reply
@Keyholder
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants