Dox class
Constructors
Dox ()
factory
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. AES needs a key
of 16, 24 or 32 bytes, so a longer key breaks encrypted cookies.
in development, local and test 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
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)