Set different domain for public domain and fucntions API

I have a site on cloudflare pages using pages functions. the functions also acts like an rest Api validating through API or Sessions. My question now is how I can make the domain on the public for cloudflare pages app.mydomain.com and then the functions acting as API can be api.mydomain.com currently all are on mydomain.com so mydomain.com is for the main site and mydomain.com/apiendpoint is for the Api Trying to separate it, if possible 🙏
Z
z0rrn•16d ago
You need to set up a second pages project.
MO
Manuel Ogomigo•16d ago
oh okay got it, that will be just for the API right?
Z
z0rrn•15d ago
Yes, exactly. One for the API and one for the App.
MO
Manuel Ogomigo•15d ago
Thank you!