Fork me on GitHub
#pedestal
<
2016-11-03
>
jimmy02:11:17

does anyone here has used clojure pedestal with google cloud endpoints ?

grant02:11:40

I'm pretty new to building web stuff, so please forgive the possibly silly question. What do you mean by "clojure endpoints"?

jimmy02:11:46

@grant Sorry, I meant google cloud endpoints

grant02:11:28

Ah, that makes more sense. But no, haven't looked at any of the google stuff I'm afraid.

jimmy02:11:25

yeah, it's pretty much like swagger, it helps us generating a json which is a description of the service, then we can generate client api ( ios, android , web ) based on it. And I find it's faster to use google cloud endpoints than using swagger ( in terms of hosting services ourselves )

grant03:11:59

Oh, that is cool. I tried using swagger-api with pedestal, but found that it seemed to get in the way more than it helped.

grant03:11:43

Plus I'm not exposing anything for direct access by anyone else, so there wasn't much advantage except for some pretty docs.

mtnygard14:11:29

Hi @grant, late response b/c I was traveling. When you say :origin nil are you talking about a header?

grant14:11:33

Hi Michael. Yes, that is what I was talking about. And I actually figured out what I was trying to do. Just adding the route worked. Though I am still curious if it is possible to do per route origin checking.

mtnygard15:11:11

I don't think there's a direct way to do it in the current routers. There are a couple of ways to solve the problem. They just take a bit more work.

mtnygard15:11:29

1. You could create an "origin router". It would sit in front of two or more regular routers. Instead of looking at the path in the request, it would look at the origin then enqueue one of the other routers. This would work best if you've got several routes that should be treated differently based on origin.

mtnygard15:11:32

2. You could create an origin interceptor. Your router would direct all requests for /api/health-check to the same interceptor vector, but if the origin doesn't match, then the origin interceptor can terminate the request. That would return a 404 exactly as if the route didn't exist.

grant15:11:36

Cool. Thanks for taking the time to answer my question. And the new pedestal docs you've been writing have been helpful too, they are appreciated.

grant23:11:04

This is a rather tangential pedestal question, but not sure there is a better place to ask it. Does anyone know if there are still plans for Paul deGrandis' Vase library to ever make it out into the wild?