Hi all, we are about to upgrade to Coldbox 6, but ...
# box-products
m
Hi all, we are about to upgrade to Coldbox 6, but still using routes.cfm from previous versions. Q: does routes.cfm is compatible with Coldbox 6? if yes, what are we missing if we do not upgrade to router.cfc ?
p
Spin it up using command box and version 6 and see what stuff needs updated.
j
Routes.cfm
is compatible with Coldbox 6, but is no longer supported in Coldbox 7.
I would suggest migrating to
Router.cfc
, and Coldbox 7, if you are doing the upgrade anyway
m
Thanks Patrick and Jon for the replies. Yes we decided to skip 6 and upgrade to 7, will rewrite our 700+ api endpoints in router.cfc
p
Just ask chatgpt to do that for ya!
m
really? that'll be fun if it works!
p
it is quite likely it can do it, give it a whirl
j
addRoute
is still a method when using
Router.cfc
so, if you are using that, you can just drop it in.
You should be able to get by with a find and replace - or regex-based find/replace - refactor, for anything else.
Just remember to terminate any methods, where you use the
route
function:
Copy code
route( "/healthcheck", function( event, rc, prc ){
			return { "status" : "OK" };
		} ).end();
If you don’t put the
end()
the route never gets added.
m
👍 thanks for the suggestions