Files
speckle-server/packages/server/bin/ts-www
T

25 lines
709 B
JavaScript
Executable File

#!/usr/bin/env node
'use strict'
/**
* Same as 'www', but runs the app from source code directly through ts-node, so no need to build the app into /dist first.
* Although ts-node with swc is pretty fast, in production environments you should use `www` and a built app.
*/
require('ts-node/register')
const { logger } = require('../observability/logging')
const { init, startHttp } = require('../app')
init()
.then(({ app, graphqlServer, server, readinessCheck }) =>
startHttp({ app, graphqlServer, server, readinessCheck })
)
.catch((err) => {
logger.error(err, 'Failed to start server. Exiting with non-zero exit code...')
// kill it with fire 🔥
process.exit(1)
})
// 💥