From bbd8b8b07b090ce4ac506e4e507f8a67b2ebc341 Mon Sep 17 00:00:00 2001 From: Steven Date: Wed, 27 May 2020 19:15:22 -0400 Subject: [PATCH] Rename zeit/og-image to vercel/og-image (#119) - Rename `now` CLI to `vercel` CLI - Rename `now.json` to `vercel.json` - Rename `.nowignore` to `.vercelignore` - Rename `zeit/og-image` to `vercel/og-image` https://vercel.com/blog/zeit-is-now-vercel --- .gitignore | 1 + .nowignore => .vercelignore | 2 +- CONTRIBUTING.md | 12 ++++++------ README.md | 12 ++++++------ api/index.ts | 2 +- public/index.html | 6 +++--- now.json => vercel.json | 1 - 7 files changed, 18 insertions(+), 18 deletions(-) rename .nowignore => .vercelignore (84%) rename now.json => vercel.json (89%) diff --git a/.gitignore b/.gitignore index bc7959f..9c5475e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .now +.vercel node_modules api/dist public/dist diff --git a/.nowignore b/.vercelignore similarity index 84% rename from .nowignore rename to .vercelignore index 77592a1..04fa760 100644 --- a/.nowignore +++ b/.vercelignore @@ -1,6 +1,6 @@ +.github node_modules api/dist public/dist CONTRIBUTING.md README.md -Dockerfile diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index aa8738e..5f78ec7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,18 +2,18 @@ There are two pieces to `og-image` that are worth noting before you begin development. -1. The backend image generator located in [/api/index.ts](https://github.com/zeit/og-image/blob/master/api/index.ts) -2. The frontend inputs located in [/web/index.ts](https://github.com/zeit/og-image/blob/master/web/index.ts) +1. The backend image generator located in [/api/index.ts](https://github.com/vercel/og-image/blob/master/api/index.ts) +2. The frontend inputs located in [/web/index.ts](https://github.com/vercel/og-image/blob/master/web/index.ts) -Vercel handles [routing](https://github.com/zeit/og-image/blob/master/now.json#L6) in an elegate way for us so deployment is easy. +Vercel handles [routing](https://github.com/vercel/og-image/blob/master/vercel.json#L6) in an elegate way for us so deployment is easy. To start hacking, do the following: -1. Clone this repo with `git clone https://github.com/zeit/og-image` +1. Clone this repo with `git clone https://github.com/vercel/og-image` 2. Change directory with `cd og-image` 3. Run `yarn` or `npm install` to install all dependencies -4. Run locally with `now dev` and visit [localhost:3000](http://localhost:3000) (if nothing happens, run `npm install -g now`) -5. If necessary, edit the `exePath` in [options.ts](https://github.com/zeit/og-image/blob/master/api/_lib/options.ts) to point to your local Chrome executable +4. Run locally with `vercel dev` and visit [localhost:3000](http://localhost:3000) (if nothing happens, run `npm install -g vercel`) +5. If necessary, edit the `exePath` in [options.ts](https://github.com/vercel/og-image/blob/master/api/_lib/options.ts) to point to your local Chrome executable Now you're ready to start local development! diff --git a/README.md b/README.md index 9f9ea04..e14954a 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ # [Open Graph Image as a Service](https://og-image.now.sh) - - + + Serverless service that generates dynamic Open Graph images that you can embed in your `` tags. @@ -54,10 +54,10 @@ You'll want to fork this repository and deploy your own image generator. 1. Click the fork button at the top right of GitHub 2. Clone the repo to your local machine with `git clone URL_OF_FORKED_REPO_HERE` 3. Change directory with `cd og-image` -4. Make changes by swapping out images, changing colors, etc (see [contributing](https://github.com/zeit/og-image/blob/master/CONTRIBUTING.md) for more info) -5. Hobby plan users will need to remove all configuration inside `now.json` besides `rewrites` -6. Run locally with `now dev` and visit [localhost:3000](http://localhost:3000) (if nothing happens, run `npm install -g now`) -7. Deploy to the cloud by running `now` and you'll get a unique URL +4. Make changes by swapping out images, changing colors, etc (see [contributing](https://github.com/vercel/og-image/blob/master/CONTRIBUTING.md) for more info) +5. Hobby plan users will need to remove all configuration inside `vercel.json` besides `rewrites` +6. Run locally with `vercel dev` and visit [localhost:3000](http://localhost:3000) (if nothing happens, run `npm install -g vercel`) +7. Deploy to the cloud by running `vercel` and you'll get a unique URL 8. Setup [GitHub](https://vercel.com/github) to autodeploy on push If you are using a paid plan, you can do a one-click deploy with the button below. diff --git a/api/index.ts b/api/index.ts index e9f7b8f..8c8e080 100644 --- a/api/index.ts +++ b/api/index.ts @@ -3,7 +3,7 @@ import { parseRequest } from './_lib/parser'; import { getScreenshot } from './_lib/chromium'; import { getHtml } from './_lib/template'; -const isDev = process.env.NOW_REGION === 'dev1'; +const isDev = process.env.VERCEL_REGION === 'dev1'; const isHtmlDebug = process.env.OG_HTML_DEBUG === '1'; export default async function handler(req: IncomingMessage, res: ServerResponse) { diff --git a/public/index.html b/public/index.html index c5b13c2..6370529 100644 --- a/public/index.html +++ b/public/index.html @@ -13,7 +13,7 @@
- +

What is this?

This is a service that generates dynamic Open Graph images that you can embed in your <meta> tags.

For each keystroke, headless chromium is used to render an HTML page and take a screenshot of the result which gets cached.

-

Find out how this works and deploy your own image generator by visiting GitHub.

- +

Find out how this works and deploy your own image generator by visiting GitHub.

+
diff --git a/now.json b/vercel.json similarity index 89% rename from now.json rename to vercel.json index e44a282..0470829 100644 --- a/now.json +++ b/vercel.json @@ -1,6 +1,5 @@ { "regions": ["all"], - "public": true, "functions": { "api/**": { "memory": 3008