Skip to content

Commit

Permalink
fix: Static files for swagger (#259)
Browse files Browse the repository at this point in the history
* fix: Add static files to the dist folder

* fix: small fix with path to copy

* fix: Skip API guarding for .js files

* Move to path.join for static files

* Move to relative path
  • Loading branch information
Andrew Nikitin authored Jun 13, 2023
1 parent d0bce71 commit a1fe566
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ import swaggerJSONDoc from '../swagger.json' assert { type: "json" }

import * as dotenv from 'dotenv'
import { UserInfo } from './controllers/user_info.js'
import path from 'path'

const swagger_options = {
customJs: '/custom_button.js',
customJs: './custom_button.js',
}

dotenv.config()
Expand Down Expand Up @@ -55,7 +56,7 @@ class App {
this.express.use(handleAuthRoutes(configLogToExpress))
this.express.use(withLogto(configLogToExpress))
this.express.use(express.text())
this.express.use(express.static(process.cwd() + '/src/static'))
this.express.use(express.static(path.join(process.cwd(), '/src/static')))

this.express.use(
'/swagger',
Expand Down
File renamed without changes.

0 comments on commit a1fe566

Please sign in to comment.