Вопрос

I am new to node, so please excuse me if I am asking stupid questions.

Ghost has been released as NPM module recently. I am trying to integrate it with my application, so I could have custom home page and serve blog on a separate page. Once I do following in my app.js, it takes over all the traffic to my site. How do I configure ghost to serve only the blog?

var ghost = require('ghost'); ghost();

Это было полезно?

Решение

We're missing a few details here so I'll make some assumptions.

If you are hosting node using the default server than (as of this posting) you are out of luck since ghost is setup to run in it's own standalone server. One possible solution is to run both the standard node.js server for your page then another for ghost. That's obviously not ideal but until they fix their integration issues you don't have much choice.

Другие советы

I'm trying to solve the same problem, and currently imagine finding a hosting that allows me to run two node instances (I think that is quite possible with e.g. digital ocean). One - port 80 - will point to Ghost, while the other (on some other port) will host the REST API for the app.

I will then create a blank page linked to a custom template that loads the rest of my angular application - the files will be stored in the assets folder of my custom template, while ajax calls will simply be to the non-standard port.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top