UNPKG

@json-express/core

Version:

Zero-config JSON server with REST API, JWT authentication, HTTPS support, schema validation & search. Perfect for rapid prototyping, API mocking, and development.

15 lines (10 loc) 450 B
import getPort from 'get-port' import { getConfig, upsertConfig } from '../db/config-store.js' import { logPortChangeMessage } from './logger-service.js' export const preparePortNumber = async () => { const configPort = getConfig('port') const portSequence = Array.from({ length: 100 }, (_, i) => configPort + i) const port = await getPort({ port: portSequence }) upsertConfig('port', port) logPortChangeMessage(configPort) }