Copy import dotenv from 'dotenv' ;
dotenv .config ();
import express from 'express' ;
import { initAIAccessPoint } from '@decloudlabs/Skynet-SmartAccessPoint /lib/init' ;
import { checkBalance } from '@decloudlabs/Skynet-SmartAccessPoint /lib/middleware/checkBalance' ;
import { protect } from '@decloudlabs/Skynet-SmartAccessPoint /lib/middleware/auth' ;
import SkyMainNodeJS from '@decloudlabs/skynet/lib/services/SkyMainNodeJS' ;
import { getSkyNode } from './clients/skynet' ;
const app = express ();
const port = process . env . PORT || 3000 ;
const setupAccessPoint = async () => {
const skyNode : SkyMainNodeJS = await getSkyNode ();
await initAIAccessPoint (
skyNode ,
checkBalanceCondition ,
applyCosts ,
app ,
runNaturalFunction
);
app .listen (port , () => {
console .log ( `Server running on port ${ port } ` );
});
};
setupAccessPoint ();