Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic routes not working? #48

Closed
laolsson opened this issue Apr 5, 2016 · 8 comments
Closed

Dynamic routes not working? #48

laolsson opened this issue Apr 5, 2016 · 8 comments

Comments

@laolsson
Copy link

laolsson commented Apr 5, 2016

First off, thanks for an amazing project! I've just started trying it out and I've run in to a problem.

This programming works locally:
`import flask

app = flask.Flask(name)

@app.route('/client/', methods=['GET'])
def hello(id):
return 'Hello ' + id

if name == 'main':
app.run()`

But when I deploy I and try with something like
https://107uk4y3sh.execute-api.ap-northeast-1.amazonaws.com/prod4/client/VVV

I get {"message": "Missing Authentication Token"}

Is there anything I need to do in zappa_settings.json to get this work. Changing the code to just have /client as path works fine.

Thanks

@Miserlou
Copy link
Owner

Miserlou commented Apr 5, 2016

That code doesn't work locally either. You need to add to the route string.

@Miserlou Miserlou closed this as completed Apr 5, 2016
@laolsson
Copy link
Author

laolsson commented Apr 5, 2016

My bad, pasted the wrong code. This works locally:

import flask

app = flask.Flask(__name__)

@app.route('/client/<id>', methods=['GET'])
def hello(id):
    return 'Hello ' + id


if __name__ == '__main__':
    app.run()

But not when deployed

@Miserlou
Copy link
Owner

Miserlou commented Apr 5, 2016

Going to sleep now, will check in the morning. Thanks for reporting.

@Miserlou Miserlou reopened this Apr 5, 2016
@Miserlou
Copy link
Owner

Miserlou commented Apr 5, 2016

@Miserlou
Copy link
Owner

Miserlou commented Apr 5, 2016

Maybe it doesn't work in Asia Pacific region yet? Try US East?

https://oo8j6uj6i1.execute-api.us-east-1.amazonaws.com/dev4/client/VVV

@collingreen
Copy link
Collaborator

I just had the same issue when creating a brand new lambda (not zappa) endpoint with an api gateway in us-west-2 -- could just be slow setup of the api gateway part (it does warn about a potential 15 minute setup time).

@laolsson
Copy link
Author

laolsson commented Apr 5, 2016

zappa works fine, this was a PEBKAC problem: for some reason I had set the 'parameter_depth' parameter to 1

@laolsson laolsson closed this as completed Apr 5, 2016
@Miserlou
Copy link
Owner

Miserlou commented Apr 5, 2016

Ah, okay! (I just did that for the demo demo gif to make it go faster!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants