diff --git a/.gitignore b/.gitignore index bc7959f8b..9c5475ea0 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 77592a1c9..04fa7601f 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 aa8738ebf..5f78ec7b6 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 9f9ea0489..e14954a3c 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 e9f7b8f77..8c8e0807b 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 c5b13c26c..637052986 100644 --- a/public/index.html +++ b/public/index.html @@ -13,7 +13,7 @@