Build and Deploy Universal JavaScript Servers
npm install holepackhole-app
bash
mkdir hole-app
cd hole-app
`
1️⃣ Create routes/index.ts:
`ts [routes/index.ts]
export default defineEventHandler(() => "hole is amazing!");
`
2️⃣ Start development server:
`bash
npx holepack dev
`
🪄 Your API is ready at http://localhost:3000/
Check .hole/dev/index.mjs if want to know what is happening
3️⃣ You can now build your production-ready server:
`bash
npx holepack build
`
4️⃣ Output is in the .output directory and ready to be deployed on almost any VPS with no dependencies. You can locally try it too:
`bash
node .output/server/index.mjs
``