Skip to content

Latest commit

 

History

History
53 lines (52 loc) · 1.19 KB

README.md

File metadata and controls

53 lines (52 loc) · 1.19 KB

developer.kaadon.com

httpServer client for the node.js

HTTPSERVER配置

json 配置
    {
        "HTTPSERVER":{
            "HOST":"127.0.0.1",
            "PORT":"4501"
        }
    }
dotenv 配置
#dotenv
HTTPSERVER='{"HOST":"127.0.0.1","PORT":"4501"}'

example

HAPI
import {HapiInit} from "../httpserver";
const Hapi = HapiInit()
const server = async () => {
await  Hapi.init().then().catch(console.log)
console.log(Hapi.serverClient )
}
server().then(r => console.log).catch(console.log)
process.on('unhandledRejection', (err) => {
process.exit(1);
});
SOCKET
import {HapiInit,SocketInit} from "../httpserver";
const Hapi = HapiInit()
const server = async () => {
await  Hapi.init().then().catch(console.log)
SocketInit(Hapi.serverClient.listener)
}
server().then(r => console.log).catch(console.log)
process.on('unhandledRejection', (err) => {
process.exit(1);
});