Silex is zero-config to start and can be extended with flexible configuration options.
Zero config was inspired by 11ty and it means that Silex can run without any command line parameters or configuration files.
We’ve taken care to setup Silex so that running the silex
command uses sensible defaults. Lower the barrier to entry for that first project to get up and running faster.
You may be interested in this project: Silex edition with a dashboard for multi-sites and other useful options. It is used for v3.silex.me free instance.
If you are planing to contribute code to Silex, you will need to run Silex from source, please check this guide about how to contribute
OS | Supported | Tester |
---|---|---|
Linux (Fedora) | ✓ | @lexoyo |
Windows | ? | |
MacOS | ? | |
Other | ? |
Requirements
Use Silex official docker image
$ docker run -p 6805:6805 silexlabs/silex
Then open http://localhost:6805
The default options can be overriden with environment variables using the -e
option in docker run, see the list of all available options
$ docker run -p 8080:8080 -e PORT=8080 silexlabs/silex
OS | Supported | Tester |
---|---|---|
Linux (Fedora) | ✓ | @lexoyo |
Windows | ? | |
MacOs | ? | |
Other | ? |
Requirements
Install and launch Silex from the command line with the following command:
npx @silexlabs/silex
Then open http://localhost:6805
The CLI supports a number of options, allowing you to customize Silex's behavior, see the list of options here
To use these options, simply append them to the command line when launching Silex. For example:
npx @silexlabs/silex --port=8000 --debug=true
This would start Silex, listening on port 8000, with debug mode enabled.
If you want to install Silex globally with npm, you can do so with the following command:
npm install -g @silexlabs/silex
This command tells npm to install the package '@silexlabs/silex' globally (-g
flag), which means you can use it from any directory on your machine.
After installing Silex globally, you can launch it from anywhere with:
silex
Just like when using npx, you can also pass command-line options when launching Silex:
silex --port=8000 --debug=true
This will start Silex, listening on port 8000, with debug mode enabled.
Or you can use the environment variables of your OS too set the options
$ PORT=8080 npx @silexlabs/silex
Which is equivalent to this with Silex globally installed (npm install -g @silexlabs/silex
)
$ PORT=8080 silex
You can configure Silex using environment variables and command-line options. All available options can be found in the docs about options. Also you can read more about Silex configuration here
There are config files (same as plugins) in the examples/
folder of Silex repository. To start Silex locally with these config:
$ SILEX_CLIENT_CONFIG=./examples/client-config-transformers.js SILEX_CONFIG=`pwd`/examples/server-config-plugins.js npm run start:debug