File tree Expand file tree Collapse file tree 4 files changed +10
-12
lines changed
services/object-mapping-indexer/src Expand file tree Collapse file tree 4 files changed +10
-12
lines changed Original file line number Diff line number Diff line change 1+ import 'dotenv/config'
12import { env , notNaN } from './utils/env.js'
23
34export const config = {
45 port : Number ( env ( 'OBJECT_MAPPING_INDEXER_PORT' , '3000' ) ) ,
56 requestSizeLimit : env ( 'REQUEST_SIZE_LIMIT' , '200mb' ) ,
67 corsAllowOrigins : env ( 'CORS_ALLOW_ORIGINS' , '' ) ,
78 nodeRpcUrl : env ( 'NODE_RPC_URL' ) ,
8- recoveryInterval : notNaN ( Number ( env ( 'RECOVERY_INTERVAL' , '100 ' ) ) ) ,
9+ recoveryInterval : notNaN ( Number ( env ( 'RECOVERY_INTERVAL' , '1000 ' ) ) ) ,
910 logLevel : env (
1011 'LOG_LEVEL' ,
1112 process . env . NODE_ENV === 'production' ? 'info' : 'debug' ,
Original file line number Diff line number Diff line change 1- import './server.js'
1+ import './rpc/ server.js'
22import './listeners.js'
Original file line number Diff line number Diff line change @@ -2,8 +2,11 @@ import http from 'http'
22import { objectMappingRouter } from '../services/objectMappingRouter/index.js'
33import { ObjectMappingIndexerRPCApi } from '@auto-files/rpc-apis'
44import { expressApp } from '../http/api.js'
5+ import { Application } from 'express'
6+ import { config } from '../config.js'
7+ import { logger } from '../drivers/logger.js'
58
6- const createObjectMappingsRPCServer = ( app : Express . Application ) => {
9+ const createObjectMappingsRPCServer = ( app : Application ) => {
710 return ObjectMappingIndexerRPCApi . createServer (
811 {
912 subscribe_object_mappings : async ( _ , { connection } ) => {
@@ -40,7 +43,9 @@ const createObjectMappingsRPCServer = (app: Express.Application) => {
4043 } ,
4144 {
4245 server : {
43- httpServer : http . createServer ( app ) ,
46+ httpServer : app . listen ( config . port , ( ) => {
47+ logger . info ( `Server is running on port ${ config . port } ` )
48+ } ) ,
4449 callbacks : { } ,
4550 } ,
4651 } ,
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments