Deploy and serve web projects locally for preview. Automatically detects project type (Node.js or static HTML) and starts the appropriate development server.
Automatically detect the project type and start the appropriate development server.
Node.js web project
package.json in the workspace rootdev or start scriptnpm run dev (or npm start if dev is not available)Static website
.html files in the workspace (especially index.html)python3 -m http.server 8000 to serve static files# Step 1: Check if this is a Node.js project
if [ -f "package.json" ]; then
# Check for dev script
if grep -q '"dev"' package.json; then
npm run dev
elif grep -q '"start"' package.json; then
npm start
fi
# Step 2: Check for static HTML files
elif [ -f "index.html" ] || ls *.html 1> /dev/null 2>&1; then
python3 -m http.server 8000
fi
npm install) before running Node.js projects