Buckets:
| import { DEFAULT_WEB_APP_PORT } from '../shared/constants.js'; | |
| import { parseArgs } from 'node:util'; | |
| import { logger } from './utils/logger.js'; | |
| import { runApplication } from './run-application.js'; | |
| const { values } = parseArgs({ | |
| options: { | |
| port: { type: 'string', short: 'p' }, | |
| json: { type: 'boolean', short: 'j' }, | |
| }, | |
| args: process.argv.slice(2), | |
| }); | |
| logger.info('Starting Streamable HTTP server...'); | |
| if (values.json) { | |
| logger.info('JSON response mode enabled'); | |
| } | |
| process.env.NODE_ENV = process.env.NODE_ENV || 'production'; | |
| const port = parseInt(values.port || process.env.WEB_APP_PORT || DEFAULT_WEB_APP_PORT.toString()); | |
| async function start() { | |
| const useJsonMode = values.json || false; | |
| const transportType = useJsonMode ? 'streamableHttpJson' : 'streamableHttp'; | |
| await runApplication({ | |
| transportType, | |
| port, | |
| }); | |
| } | |
| start().catch((error) => { | |
| logger.error({ error }, 'Server startup error'); | |
| process.exit(1); | |
| }); | |
| //# sourceMappingURL=streamableHttp.js.map |
Xet Storage Details
- Size:
- 1.06 kB
- Xet hash:
- 7bf48a25299c48dd46816fdf863ebd6b94c708b29a7e86d42cd18f4e41ca9139
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.