veliovgroup / flow-router

🚦 Carefully extended flow-router for Meteor
https://packosphere.com/ostrio/flow-router-extra
BSD 3-Clause "New" or "Revised" License
202 stars 29 forks source link

Server side Routes #23

Closed jamgold closed 7 years ago

jamgold commented 7 years ago

I am writing an application that should provide some REST interface, but can't get server side routes working, not even with Picker. Am I missing something?

dr-dimitru commented 7 years ago

Hello @jamgold ,

For this purpose you need to create local package (placed above ostrio:flow-router-extra in the .meteor/packages file).

It can be easily done using webapp package only, or extending it with solutions like express.js, connect.js and similar.

Maybe simpler will be to use simple:rest package.

It's up to you, saying that ostrio:flow-router-extra should be considered as Client-only solution

jamgold commented 7 years ago

Hello @dr-dimitru ,

thank you for answering. I have figured out how to use Picker. My main confusion was that I have assets in public for which there are not routes, of course. If a request is made to something in public that does not exist, the not-found route kicks in, which unfortunately is indistinguishable from a successful request (no status 404). Do you know how to manipulate the HTTP Status with this router?

dr-dimitru commented 7 years ago

Not currently possible with Meteor. It's Meteor's "feature" and not related to FR package. It's common for most of the front-end JS solutions, and not Meteor specific.

But if you're looking 404 response codes (genuine status code) for SEO (Google, Yahoo, etc.) optimization, take a look on:

jamgold commented 7 years ago

Thank you again, will check it out.