Interface: JovaServerOptions
Jova Server options.
JovaServerOptions
Properties
basePath?
optional
basePath:string
An optional base path for all of your routes to begin at.
Example
"/api"
Defined in
types/config/jovaServerOptionsObject.ts:30
cors?
optional
cors:CorsOptions
Enable cors and set up certain values for the cors middleware.
Default
undefined
Defined in
types/config/jovaServerOptionsObject.ts:92
customHeaders?
optional
customHeaders:JovaHeaderSetting
[]
Custom headers to be applied to outgoing responses, this is a middleware of optional use but the headers put in here are read-only at runtime until the request is received by a request handler.
Default
[]
Defined in
types/config/jovaServerOptionsObject.ts:86
customOptions?
optional
customOptions:JovaCustomOption
[]
Custom options from express to be set upon the server starting, similar to settings
but this sets any value unlike settings
which only allows settings from the JovaSettingsTable
enum.
Default
[]
Defined in
types/config/jovaServerOptionsObject.ts:80
middlewares?
optional
middlewares:MiddlewareHandler
[]
An array containing middlewares you would like to use in your application.
Middlewares built to support Express only, or alternatively you can write them in yourself.
Example
// An example of a middleware component coded raw into Jova's Middleware Array.
((request: Request, response: Response, next: NextFunction) => {
console.log(`New request at ${request.path}!`)
return next()
})
Defined in
types/config/jovaServerOptionsObject.ts:44
paths?
optional
paths:JovaPathSettings
Deploy example middlewares and routes when running the Jova.js Server.
Defined in
types/config/jovaServerOptionsObject.ts:23
port?
optional
port:string
|number
The port for the Jova Server to run on.
Default
3000
Defined in
types/config/jovaServerOptionsObject.ts:50
ratelimiting?
optional
ratelimiting:RatelimitConfig
The ratelimit config for a Jova Server Instance.
Default
undefined // (Disabled by default)
Example
// Config types for the ratelimiting feature for Jova
interface LimitConfig {
refreshTime: number;
requestLimitAmount: number | Middleware;
requestLimitMessage?: string;
requestLimitCode?: string;
requestLimitHandler?: Middleware;
countFailedRequests?: boolean;
allowOnInternalError?: boolean;
ratelimitDatabase?: string | RatelimitDatabaseConfig;
}
Defined in
types/config/jovaServerOptionsObject.ts:68
settings?
optional
settings:JovaSettings
Custom settings from express to be enabled or disabled upon the server starting.
Default
undefined