-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Serva currently accepts 4 configuration values to create an App instance. These options should be able to be overwritten by flags, environment variables, config, and defaults (in that order).
interface ServaConfig {
port: number;
hostname?: string;
extension: string;
methods: string[];
}1.Flags
$ serva start \
--port 4500 \
--hostname localhost \
--extension ".ts" \
--methods get,post,put,delete,patch2. Environment
# Port
SERVA_PORT=4500
# Host (ordered in priority)
SERVA_HOSTNAME=localhost
SERVA_HOST=localhost
# Extension (ordered in priority)
SERVA_EXTENSION=".ts"
SERVA_EXT=".ts"
# Methods
SERVA_METHODS="get,post,put,delete,patch"3. Config file
{
"port": 4500,
"hostname": "localhost",
"extension": ".ts",
"methods": [
"get",
"post",
"put",
"delete",
"patch"
]
}4. Defaults
const DEFAULT_CONFIG = {
port: 4500,
extension: ".ts",
methods: [
"get",
"post",
"put",
"delete",
"patch"
]
};Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request