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

Vercel deployment broken #31

Closed
dobesv opened this issue Jun 23, 2022 · 1 comment · Fixed by #33
Closed

Vercel deployment broken #31

dobesv opened this issue Jun 23, 2022 · 1 comment · Fixed by #33

Comments

@dobesv
Copy link

dobesv commented Jun 23, 2022

Recently I changed this package to use the "standard" environment variables for AWS access. However, in #30 (comment) it was revealed that for Vercel deployment for whatever reason they do not allow those environment variables to be used.

Some fallback environment variables will likely be needed to support Vercel deployment.

Docs:

Vercel deployments will not work until that is resolved.

This may be as simple as changing vercel.ts like this:

import type { VercelRequest, VercelResponse } from '@vercel/node'
import { createApp } from './app'

// Propage any environment vars APP_AWS_* to AWS_* to workaround
// vercel restriction on environment variables
Object.keys(process.env).filter(k => k.startsWith('APP_AWS_')).forEach(k => {
  process.env[k.substring(4)] = process.env[k];
})

const app = createApp()

export default async function (req: VercelRequest, res: VercelResponse) {
  await app.ready()
  app.server.emit('request', req, res)
}
@fox1t
Copy link
Collaborator

fox1t commented Jun 28, 2022

I am not sure that this is the correct snippet. We should remap S3_ to AWS_.

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