Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/char0n/swagger-ui-nuxt
POC of Nuxt@3 + swagger-ui-react integration
https://github.com/char0n/swagger-ui-nuxt
nuxt nuxtjs swagger-ui
Last synced: about 1 month ago
JSON representation
POC of Nuxt@3 + swagger-ui-react integration
- Host: GitHub
- URL: https://github.com/char0n/swagger-ui-nuxt
- Owner: char0n
- Created: 2023-09-06T05:46:00.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-09T08:49:13.000Z (about 1 year ago)
- Last Synced: 2024-10-06T01:21:49.316Z (4 months ago)
- Topics: nuxt, nuxtjs, swagger-ui
- Language: Vue
- Homepage:
- Size: 281 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# swagger-ui + Nuxt@3
This repo serves as POC of integrating [swagger-ui-react](https://github.com/swagger-api/swagger-ui) with [Nuxt@3](https://nuxt.com/).
As Nuxt@3 works with React@18 by default, and SwaggerUI is still on React@17, we need to provide aliases for React@17 in `nuxt.config.js`:
```ts
alias: {
react: fileURLToPath(new URL('./node_modules/swagger-ui/node_modules/react/umd/react.production.min.js', import.meta.url)),
'react-dom': fileURLToPath(new URL('./node_modules/swagger-ui/node_modules/react-dom/umd/react-dom.production.min.js', import.meta.url)),
}
```# Nuxt 3 Minimal Starter
Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.
## Setup
Make sure to install the dependencies:
```bash
# npm
npm install# pnpm
pnpm install# yarn
yarn install
```## Development Server
Start the development server on `http://localhost:3000`:
```bash
# npm
npm run dev# pnpm
pnpm run dev# yarn
yarn dev
```## Production
Build the application for production:
```bash
# npm
npm run build# pnpm
pnpm run build# yarn
yarn build
```Locally preview production build:
```bash
# npm
npm run preview# pnpm
pnpm run preview# yarn
yarn preview
```Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.