UNPKG

@dooboostore/simple-boot-http-server-ssr

Version:
1 lines 1.49 kB
var t={d:(e,s)=>{for(var i in s)t.o(s,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:s[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{t:()=>s});class s{constructor({rootRouter:t,container:e,cache:s,advice:i=[],proxy:r,using:o}={}){this.rootRouter=t,this.container=e,this.advice=i,this.proxy=r,this.using=o,this.cache=s}addAdvicce(t){this.advice??(this.advice=[]),this.advice.push(t)}setAdvice(...t){return this.advice=t,this}}const i=e.t;class r extends i{constructor({serverOption:t,listen:e,filters:s,requestEndPoints:i,closeEndPoints:o,errorEndPoints:n,sessionOption:h,globalAdvice:a,fileUploadTempPath:c,noSuchRouteEndPointMappingThrow:p,transactionManagerFactory:d}={},l){super(l),this.serverOption=t,this.listen=Object.assign({port:r.DEFAULT_PORT,hostname:r.DEFAULT_HOSTNAME},e),this.filters=s,this.requestEndPoints=i,this.closeEndPoints=o,this.errorEndPoints=n,this.sessionOption=Object.assign({key:"SBSESSIONID",expiredTime:18e5},h),this.globalAdvice=a,this.fileUploadTempPath=c,this.noSuchRouteEndPointMappingThrow=p,this.transactionManagerFactory=d}get hostname(){return this.listen.hostname}get port(){return this.listen.port}get protocol(){return this.isSecure?"https":"http"}get address(){return`${this.protocol}://${this.hostname}:${this.port}`}get isSecure(){return this.serverOption&&"key"in this.serverOption&&"cert"in this.serverOption}}r.DEFAULT_PORT=8081,r.DEFAULT_HOSTNAME="127.0.0.1";class o extends r{}export{o as HttpSSRServerOption};