将 Nuxt 与 Coolify 集成,以简化您的部署并为您的自托管基础设施创建自定义仪表板。
# Using npm
npm install nuxt-coolify
# Using pnpm
pnpm add nuxt-coolify
# Using yarn
yarn add nuxt-coolify
nuxt.config.tsexport default defineNuxtConfig({
modules: ['nuxt-coolify'],
})
.envNUXT_COOLIFY_INSTANCES_DEFAULT_BASE_URL=<your-coolify-url>
NUXT_COOLIFY_INSTANCES_DEFAULT_API_TOKEN=<your-coolify-api-token>
<script setup lang="ts">
const { data: instances, refresh } = useFetch('/api/v1/coolify/instances')
</script>
<template>
<div>
<h2>Coolify Instances</h2>
<pre>{{ instances }}</pre>
<button @click="refresh">Refresh</button>
</div>
</template>
# Install dependencies
npm install
# Generate type stubs
npm run dev:prepare
# Develop with the playground
npm run dev
# Build the playground
npm run dev:build
# Run ESLint
npm run lint
# Run Vitest
npm run test
npm run test:watch
# Release new version
npm run release