Skip to content

Commit

Permalink
cta: web-server->api-server
Browse files Browse the repository at this point in the history
  • Loading branch information
Roy Razon committed Jul 26, 2023
1 parent 952f4f9 commit 7679c29
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions packages/compose-tunnel-agent/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import pinoPretty from 'pino-pretty'
import { EOL } from 'os'
import { ConnectionCheckResult, requiredEnv, checkConnection, formatPublicKey, parseSshUrl, SshConnectionConfig, tunnelNameResolver } from '@preevy/common'
import createDockerClient from './src/docker'
import createWebServer from './src/web'
import createApiServer from './src/api-server'
import { sshClient as createSshClient } from './src/ssh'

const homeDir = process.env.HOME || '/root'
Expand Down Expand Up @@ -120,14 +120,14 @@ const main = async () => {
await rimraf(listenAddress)
}

const webServer = createWebServer({
log: log.child({ name: 'web' }),
const apiServer = createApiServer({
log: log.child({ name: 'api' }),
currentSshState: async () => (
await currentTunnels
),
})
.listen(listenAddress, () => {
log.info(`listening on ${inspect(webServer.address())}`)
log.info(`listening on ${inspect(apiServer.address())}`)
})
.on('error', err => {
log.error(err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const respondJson = (

const respondNotFound = (res: http.ServerResponse) => respond(res, 'Not found', 'text/plain', 404)

const createWebServer = ({
const createApiServer = ({
log, currentSshState,
}: {
log: Logger
Expand All @@ -42,4 +42,4 @@ const createWebServer = ({
respondNotFound(res)
})

export default createWebServer
export default createApiServer

0 comments on commit 7679c29

Please sign in to comment.