Skip to content

Commit

Permalink
rename cli param config to server-config
Browse files Browse the repository at this point in the history
  • Loading branch information
lexoyo committed Nov 3, 2023
1 parent a180047 commit fe818a6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .env.default
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SILEX_PORT=6805 # 6805 is the date of sexual revolution started in paris france
SILEX_HOST=localhost
SILEX_PROTOCOL=http
SILEX_DEBUG=FALSE
SILEX_CONFIG=
SILEX_SERVER_CONFIG=
SILEX_SSL_PORT=
SILEX_FORCE_HTTPS=
SILEX_SSL_PRIVATE_KEY=
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ENV SILEX_PORT=6805
ENV SILEX_HOST=localhost
ENV SILEX_PROTOCOL=http
ENV SILEX_DEBUG=FALSE
ENV SILEX_CONFIG=
ENV SILEX_SERVER_CONFIG=
ENV SILEX_SSL_PORT=
ENV SILEX_FORCE_HTTPS=
ENV SILEX_SSL_PRIVATE_KEY=
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ You can configure Silex using environment variables and command-line options. Al
There are config files (same as plugins) in the `examples/` folder. To start Silex locally with these config:

```sh
$ SILEX_CLIENT_CONFIG=./examples/client-config-transformers.js SILEX_CONFIG=`pwd`/examples/server-config-plugins.js npm run start:debug
$ SILEX_CLIENT_CONFIG=./examples/client-config-transformers.js SILEX_SERVER_CONFIG=`pwd`/examples/server-config-plugins.js npm run start:debug
```

## Contributing
Expand Down
8 changes: 4 additions & 4 deletions src/ts/server/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ const options = parse({
'host': ['', 'Sets the host param of the express module "cookie-session".', 'string'],
'port': [ 'p', 'Port to listen to', 'int'],
'protocol': ['', 'Sets the protocol param of the express module "cookie-session".', 'string'],
'config': [ 'c', 'Path for the server side config file to load at startup', 'file'],
'client-config': ['', 'Path to client config file to be served on .silex-client.js', 'string'],
'server-config': [ 's', 'Path for the server side config file to load at startup', 'file'],
'client-config': ['c', 'Path to client config file to be served on .silex-client.js', 'file'],
'fs-root': ['', 'Path to the root folder where to store websites. Used by the default storage connector (fs).', 'string'],
'fs-hosting-root': ['', 'Path to the root folder where to publish websites. Used by the default hosting connector (fs).', 'string'],
'session-name': ['', 'Sets the name param of the express module "cookie-session".', 'string'],
'session-secret': ['s', 'Session secret', 'string'],
'session-secret': ['', 'Session secret', 'string'],
'ssl-port': [ false, 'Port to listen to for SSL/HTTPS', 'int'],
'force-https': [ false, 'Force HTTPS', 'boolean'],
'ssl-private-key': [ false, 'Path to private key for SSL', 'file'],
Expand All @@ -47,7 +47,7 @@ if(options['url']) process.env.SILEX_URL = options['url']
if(options['host']) process.env.SILEX_HOST = options['host']
if(options.port) process.env.SILEX_PORT = options.port
if(options['protocol']) process.env.SILEX_PROTOCOL = options['protocol']
if(options.config) process.env.SILEX_CONFIG = options.config
if(options['server-config']) process.env.SILEX_SERVER_CONFIG = options['server-config']
if(options['client-config']) process.env.SILEX_CLIENT_CONFIG = options['client-config']
if(options['fs-root']) process.env.SILEX_FS_ROOT = options['fs-root']
if(options['fs-hosting-root']) process.env.SILEX_FS_HOSTING_ROOT = options['fs-hosting-root']
Expand Down
2 changes: 1 addition & 1 deletion src/ts/server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class ServerConfig extends Config {
public port = process.env.SILEX_PORT
public debug = process.env.SILEX_DEBUG === 'true'
public url = process.env.SILEX_URL?.replace(/\/$/, '') ?? `${process.env.SILEX_PROTOCOL}://${process.env.SILEX_HOST}:${process.env.SILEX_PORT}`
public userConfigPath: Plugin | undefined = process.env.SILEX_CONFIG
public userConfigPath: Plugin | undefined = process.env.SILEX_SERVER_CONFIG
public configFilePath: Plugin = resolve(__dirname, '../../../.silex.js')

// All connectors or just the storage or hosting connectors
Expand Down

0 comments on commit fe818a6

Please sign in to comment.