@nuxtjs/ngrok
@nuxtjs/ngrok
ngrok は、ローカルホストをインターネット上に公開し、簡単なテストと共有を可能にします!変更を他の人々にテストしてもらうために、DNS をいじる必要も、デプロイする必要もありません。
Nuxt ngrok
ngrok を使用して、Nuxt アプリケーションを簡単にインターネット上に公開できます。
機能
- 簡単な統合:1行の構成で ngrok を設定できます。
設定
@nuxtjs/ngrok
をインストール
npx nuxi@latest module add ngrok
nuxt.config.ts
のmodules
セクションに@nuxtjs/ngrok
を追加
export default defineNuxtConfig({
modules: [
'@nuxtjs/ngrok',
],
ngrok: {
// module options
},
})
以上です!これで、Nuxt アプリで ngrok
を使用できます ✨
Nuxt 2 のサポートについては、
@nuxtjs/ngrok@2.0.0
を使用し、v2.nuxtjs.org の手順に従ってください。
オプション
モジュールオプションを使用して、認証などを追加します。
export default defineNuxtConfig({
modules: [
'@nuxtjs/ngrok',
],
ngrok: {
authtoken_from_env: true, // Use NGROK_AUTHTOKEN environment variable
// authtoken: 'your_ngrok_authtoken', // Or use this option
auth: 'username:password',
domain: 'your_custom_domain',
production: true,
},
})
モジュールオプションの詳細をご覧ください。
使用方法
Nuxt アプリケーションを実行すると、コンソールに ngrok の URL が表示されます。
✔ Ngrok connected at https://your_ngrok_url
貢献
ローカル開発
# 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
# Release new version
npm run release