This guide will walk you through the process of running ForgeFX tools locally using Vercel Dev, which provides a development environment that closely mimics the Vercel production environment.
Prerequisites
- Node.js (v20 or later)
- Vercel CLI installed (
npm i -g vercel)
Steps to Run Your Tool
-
Navigate to your tool’s directory
Open a terminal and change to your tool’s root directory:
cd path/to/your/tool -
Install dependencies
If you haven’t already, install the project dependencies:
npm install -
Set up environment variables
Create a
.envfile in your project root and add necessary variables:KEY=VALUE -
Start Vercel Dev server
Run the following command to start the Vercel Dev server:
vercel devThis command will:
- Set up a local development environment
- Build your project
- Start a local server, typically at
http://localhost:3000
-
Access your tool
Open your web browser and navigate to
http://localhost:3000(or the URL provided in the terminal output).
Hot Reloading
Vercel Dev supports hot reloading. When you make changes to your code, the server will automatically rebuild and refresh your browser.
Vercel Configuration
Your tool should have a vercel.json file in its root directory. This file configures how Vercel deploys and runs your tool. Here’s a basic example: