简体   繁体   中英

Integrate Wordpress into node.js website on Heroku?

I have a deployed production Saas business built using node.js framework running on Heroku Cedar ( http://EasyNDA.com ). Now I would like to have a well integrated blog (the hack that's on http://Easynda.com/blog as of today is an iFrame from wordpress.com - many shortcomings).

I have a separate Wordpress.org PHP application on Heroku; however, these are separate applications on separate servers -

Is there a way to integrate Wordpress.org with my Heroku node.js application so they can be tightly integrated from a UI and URL perspective? Can a Heroku node.js Cedar instance be made to also serve Wordpress' PHP? or is there another way to do this smoothly?

You cannot run a single Heroku app with multiple languages, so you'll need to keep these as two seperate applications.

You definitely don't want to continue with the iframe since each individual post/page wouldn't be accessible via the url, and lot of other problems (which it sounds like your aware of).

Easiest solution would be to have your blog on blog.easynda.com (using a subdomain instead of a subfolder).

Then I'd suggest using a shared css file, and duplicating the html elements as much as possible. You want to keep as much of your html layout identical between the two (in terms of your header, footer, nav, etc.).

When you're mixing languages first ask yourself, can I do this all in one language? There are Node.js blog options available that may meet your requirements so I'd suggest looking at that first: Ghost

iFrames should generally be avoided unless there's absolutely no other options available. They generally create a horrible user experience, scroll bars in scroll bars, bookmark issues, all kinds of nasty stuff;

If you must mix multiple languages, like Node and WordPress, look to use a simple REST API in JSON. WordPress would only control the content then your other app could still maintain everything else for a seamless experience. This would only be my second option since you'll still likely need two different hosting environments, need to deal with different security updates on the two apps, etc.

If we're only talking about a simple blog you might be better off just building one entirely. Then you don't need to spend time worrying about integrating and learning the system.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM