Migrate from `Vercel` to `Netlify`
Opened this issue · 5 comments
Holy cloud providers! We should switch this from Vercel to Netlify, so we can use Creative Common's Netlify account. Currently this is on my personal Vercel account (which I don't mind at all) but before this is adopted by any of our web properties it should be moved to a CC-owned account.
The serverless functions here require a paid account in Vercel, due to their execution durations and memory usage. I am not sure what will be necessary on Netlify.
The main thing we'll need to do is restructure the serverless functions to the style used by Netlify. Vercel uses a pretty simple, but bespoke signature for each serverless function:
import { IncomingMessage, ServerResponse } from 'http';
export default async function handler(req, res) {
// your server-side functionality
}
Netlify serverless functions, by contrast, use the same signature as AWS Lamda functions:
exports.handler = function(event, context, callback) {
// your server-side functionality
}
So to migrate to netlify we'll need to:
- Research resource limits on Vercel / Netlify and if there's any new charges or limitations on Netlify
- Move code to match Netlify's required code structure
- Modify all serverless functions to match Netlify's function signature
- Make any modifications necessary for TypeScript on Netlify (may not require anything—I haven't researched this yet)
Hey @zackkrida, first of all, I would like to say that this is an awesome application. I really liked the concept of having an OG Image generator.
I would like to work on this one but I am not sure if I will be able to understand the code/implementation. Can you please share some resources/files that I should read before working on this.
Hey @rajat2502, both Netlify and Vercel have fantastic docs. I recommend reading the Netlify file-based config docs and the Vercel configuration docs so that you understand how to replace the vercel.json
file with the corresponding netlify.toml
file in the root of the project.
The steps after the file change would require access to CC's Netlify account so @zackkrida or I will take over from there.
Okay thanks, @dhruvkb, I will go through these docs and then work on this issue.
Hello @zackkrida is anyone currently working on this issue?
I would like to work on it