const{createServeras createSrpcServer, callFunction }=require('srpc-framework')const{ createServer }=require('http')// or httpsconstfunctions={add: ({ a, b })=>a+b}constport=8080constonStartText=`Server successfully launched on port ${port}`consthandleErrors=result=>{if(result.error){console.log(error)return'Internal Server Error'}returnresult}const{listen: startServer}=createServer({ functions, createServer,callFunction: compose(callFunction,handleErrors)})startServer(port,onStartText)