Ghost App POST Routing


#1

Using Ghost v2.2

I understand that the Ghost App is not yet really a thing but I was hoping for some answers for my issue. Who knows, maybe I can help out with the Ghost App :slight_smile:

Using the GhostApp 0.0.3, in the activate(), I have:

this.ghost.routeService.registerRouter('/twitter/:accessToken', (req, res, next) => {
	res.send(req.method);
});

package.json:

"permissions": {
     "routes": [
         "/twitter/:accessToken"
      ]
 }

What I cannot get is, how to set the methods (POST, PUT, DELETE)? This route I have is always a GET. Using Postman, I make the request using POST, I get back GET. Again, I know the Ghost App is not fully developed and was wondering if I can get my route to be either GET or POST, etc.

I also could not find anything useful inside /core/server/services/apps/proxy.js


Is Ghost lower casing the URL?
#2

@SylarRuby GhostApp really isn’t designed for this type of thing.

If you’re adding routes and associated functionality that your front end will talk to it’s best to do this outside of Ghost. Create a small app using the technology of your choice and configure your web server to proxy the relevant routes to it.


#3

Many thanks. I did, however, thought so. I guess I’ll clone down the repo and “beef it up” :wink:


#4

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