Deploying Snakeskin Projects to Vercel
This guide explains how to deploy a Snakeskin project to Vercel.
Prerequisites
-
A Snakeskin project that builds successfully with
snakeskin build - A Vercel account
- Vercel CLI installed (optional)
Option 1: Deploy via Git Integration
- Push your Snakeskin project to GitHub, GitLab, or Bitbucket
- Log in to your Vercel account
- Click "New Project"
- Import your repository
-
Configure the project:
-
Build Command:
pip install snakeskin-xplnhub && snakeskin build - Output Directory:
dist
-
Build Command:
- Click "Deploy"
Option 2: Deploy via Vercel CLI
- Install Vercel CLI:
bash
npm i -g vercel - Log in to Vercel:
bash
vercel login - Navigate to your Snakeskin project directory:
bash
cd my-snakeskin-project - Deploy to Vercel:
bash
vercel - Follow the prompts to configure your deployment
Configuration
The vercel.json file in your project configures how Vercel builds
and serves your project:
json
{
"version": 2,
"builds": [
{
"src": "dist/**",
"use": "@vercel/static"
}
],
"routes": [
{ "handle": "filesystem" },
{ "src": "/(.*)", "dest": "/dist/index.html" }
],
"buildCommand": "snakeskin build"
} Troubleshooting
- Build Fails: Make sure your project builds locally
with
snakeskin build - Missing Dependencies: Add any Python dependencies
to a
requirements.txtfile - 404 Errors: Check that your routes in
vercel.jsonare correctly configured
Notes
- Vercel primarily supports JavaScript frameworks, so you're using it as a static file host
-
The build process runs
snakeskin buildto generate static files - For more complex setups, consider using a serverless function to run Python code