#Route and page on same path with app dir

7 messages · Page 1 of 1 (latest)

sour monolith
#

Hi there! Is it possible to set up my routing so that I can have a page (GET) and a route (POST) on the same path? I know we can’t have a route.ts and page.tsx in the same directory, so what are my options to accomplish this?

#

For example, I’d like to do be able to do a POST to /notes/[id], but also render a page on the same URL

dapper spruce
#

You can't afaik

#

Server actions(still not production ready) will probably be a good usecase for this tho!

spark jacinth
#

you cannot have page.tsx and route.ts on the same path

#

you can just create a new folder and contain the route.ts