Getting Started
Let's get started with svrx now!
Install svrx
We strongly recommend to use official cli tool to manage svrx
. You can use svrx
at any place in your system after installing @svrx/cli
globally.
HINT: @svrx/cli
is used to install and load svrx
with a specific version(default to the latest one), which has nothing to do with the version of @svrx/cli
itself. You can specify the svrx version you want in command line or the .svrxrc.js
file.
@svrx/cli
stored the versions of svrx
into ~/.svrx
, you can use another directory by setting the SVRX_DIR
environment variable.
Starting A Project With Svrx
Common Commands
There are several commands in @svrx/cli
you might use frequently:
Usage
Start svrx
Before we start, you need to cd into the root of your project first. Let's say you've already got an index.html
in your project:
And without any other config, just run serve
command to start the dev server:
Then visit http://localhost:8000 to see the content of index.html
.
Command Line Options
You can pass options to change the default behavior through command line:
Check out the full option reference doc here.
.svrxrc.js
And also, you can write down all your options by creating a file named .svrxrc.js
or svrx.config.js
in the root path of your project.
And then run serve
command, svrx
will read your options from the config file automatically.
Global Settings
Sometimes, you might want some global settings on svrx. Let's say, all your projects need https
protocol, it's really unnecessary to set https
to true
in every project. You can put the global config file to the directory in which we stored the svrx packages, the default path is, as mentioned before, ~/.svrx/config
.
Yes, the structure of global config file is same as those in each project. And next time, wherever you start svrx, the https
protocol will be enabled by default.
Moreover, the global configs have the lowest priority, you can overwrite global configs in your project at any time.
Other Commands
If you want to know the installed versions of svrx
, or want to install a specific version, you might need the following commands:
You can use
svrx <command> -h
to see more help info of a command
Last updated
Was this helpful?