Dox class
Constructors
Dox ()
factory
Properties
cache
↔ CacheManager
cache stores from config.cache, made on first use in each isolate.
Cache() uses it. replace it in tests.
getter/setter pair
config
↔ AppConfig
get app config
getter/setter pair
doxProviders
↔ List <DoxProvider >
providers that run in every isolate when it starts
getter/setter pair
dtos
→ DtoRegistry
the DTOs of the app, from config.dtos. Empty before initialize .
no setter
hashCode
→ int
The hash code for this object.
no setter inherited
ioc
↔ IocContainer
global dox ioc containers
getter/setter pair
isolateCount
↔ int
The number of isolates that really run the app. It is the same in
every isolate. Dox sets it when the server starts: from
totalIsolate or config.totalIsolate, and 1 on Windows. It is 1
before that, and in DoxTestClient. Do not change it.
getter/setter pair
isolateId
↔ int
isolate Id
getter/setter pair
messages
→ MessageResolver
validation messages, from config.validationMessages.
no setter
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
server
→ DoxServer
get dox http server
no setter
validator
↔ RequestValidator
checks DTOs and schemas for req.validate<T>() and controller
parameters.
getter/setter pair
Methods
addProvider (DoxProvider provider )
→ void
add a provider that runs in every isolate when it starts
addProviders (List <DoxProvider > providers )
→ void
####### functions need to run on isolate #######
add providers that run in every isolate when it starts
checkAppKey ()
→ void
stop at startup when APP_KEY is missing, not exactly 32
characters, or a public sample key. a short or public key is easy
to guess, so anyone can sign tokens and cookies.
in development, local, test and testing it only logs a warning.
initialize (AppConfig appConfig )
→ void
initialize dox application
it load env and set config
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
startProviders ()
→ Future <void >
run setup() of every provider, then register the routes
this is internal core use only
your app do not need to call this function
startServer ()
→ Future <void >
start dox server
stop ()
→ Future <void >
Stop the server gracefully, in every isolate:
stopIsolate ()
→ Future <void >
stop for this isolate only. Internal: each isolate runs it.
toString ()
→ String
A string representation of this object.
inherited
totalIsolate (int value )
→ void
override total isolate from config
default is one per CPU core
warnCorsCredentials ()
→ void
print one warning when the CORS config allows every origin with
credentials. Browsers do not accept this. It does not change the
headers Dox sends.
warnWebSocketOrigin ()
→ void
print one warning to stderr when a Route.websocket route checks
no Origin.
Any site can then open a socket with the cookies of the user.
writeOpenApi (String dir )
→ Future <List <File > >
write openapi.json and openapi.yaml of the app routes into dir.
bin/openapi.dart calls this for dox openapi:generate.
Static Methods
serverUrl (HttpServer server )
→ String
the real address of server, like http://127.0.0.1:3000 or
http://[::]:3000 (all interfaces)