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

Stop using "builds", switch to using "functions" #33

Open
simonw opened this issue Feb 9, 2021 · 2 comments
Open

Stop using "builds", switch to using "functions" #33

simonw opened this issue Feb 9, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@simonw
Copy link
Owner

simonw commented Feb 9, 2021

https://vercel.com/docs/configuration#project/builds suggests that "builds" will eventually be deprecated. We use that here:

"builds": [{"src": "index.py", "use": "@now/python"}],

@simonw simonw added the enhancement New feature or request label Feb 9, 2021
@simonw
Copy link
Owner Author

simonw commented Feb 9, 2021

It looks like functions have to run out of an api directory - https://vercel.com/docs/configuration#project/functions

But then the "rewrites" mechanism can hopefully be used to say "all traffic to /* should be handed off to this function". https://vercel.com/docs/configuration#project/rewrites

{
  "rewrites": [
    { "source": "/about", "destination": "/about-our-company.html" },
    { "source": "/resize/:width/:height", "destination": "/api/sharp" },
    { "source": "/user/:id", "destination": "/api/user" },
    { "source": "/proxy/:match*", "destination": "https://example.com/:match*" }
  ]
}

So presumably we would need something like this:

{
  "rewrites": [
    { "source": "/:path*", "destination": "/api/datasette.py/:match*" },
  ]
}

@simonw
Copy link
Owner Author

simonw commented Feb 9, 2021

This may be why I've not been able to test the Vercel fix for the percent encoding issue in #28 - vercel/vercel#5575 (comment)

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

No branches or pull requests

1 participant