I am looking to implement a contact form system via the send-grid package and an api route within my Ghost CMS, but based on how the ghost-cli works on version upgrades in replacing the core server files, I’m curious if this is possible. Is there a way for people to extend their server config to allow for something like this while not having to worry about replicating the logic on each Ghost version upgrade?
The best answer here is write a tiny microservice to handle the backend part of this - use express, or whatever you’re comfortable with - rather than modifying Ghost.
You can run it on the same domain with a small modification to the nginx config, and deploy it when it changes, rather than redeploying Ghost or having to handle re-making the changes with every upgrade.
This is the best of all worlds, a tiny bit more work maybe, but Ghost doesn’t really offer tools for creating custom endpoints anyway.