Modifying Underlying Node.js to Customize Implementations


#1

Hi there!

We are looking for a way to be able to make API calls via Node.js from other sources, and would like to expose that data to HBS when building some of the templates/views/pages out.

I know that Pug allows us to expose data to the view when building the project. Is there a way to modify the underlying Node.js implementation in Ghost to be able to make API calls, expose data to HBS, access data in other server-side technologies like Mongo, etc.?

Thanks!
Aaron


#2

Hey :wave:

What exactly are you trying to do? A lot of what you said seems possible but it’s usually not suggested to do because you end up branching off of the standard Ghost installation. There’s usually a method to do what you want without modifying the core :slight_smile:


#3

Hi vikas!

We are trying to build custom UI elements to include on pages (in the template), such UI elements that connect to a database on the server-side, or even build out an Angular based component.

We are looking to extend Ghost past just a blogging platform.

Thanks,
Aaron


#4

Interesting! If I’m understanding what you’re saying, there’s no real dependency on Ghost, rather non-ghost APIs? If that’s the case, I would suggest bundling the components with your theme, including hardcoding your API endpoint. Then configure your load balancer / proxy to requests to the API endpoint where it normally would go.

Ghost is quite flexible, and has a powerful content api, allowing you to use it in a headless manner as well, if that might make life easier


closed #5

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.