Skip to content

Commit

Permalink
start-server.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Jun 3, 2024
1 parent 06c01da commit e51be19
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
15 changes: 0 additions & 15 deletions packages/@uppy/companion/src/standalone/start-server.js

This file was deleted.

17 changes: 17 additions & 0 deletions packages/@uppy/companion/src/standalone/start-server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env node
import companion = require('../companion')
import standalone = require('.')
import logger = require('../server/logger')

// We don't want TS to resolve the following require, otherwise it wraps the
// output files in `lib/src/` instead of `lib/`.
const { version } = require('../../package.json') as { version: string }

const port = process.env.COMPANION_PORT || process.env.PORT || 3020

const { app } = standalone()

companion.socket(app.listen(port))

logger.info(`Welcome to Companion! v${version}`)
logger.info(`Listening on http://localhost:${port}`)

0 comments on commit e51be19

Please sign in to comment.