@fizzmod/devserver v0.0.32
VTEX Flash
Author: Marcos Casagrande marcoscvp90@gmail.com
Copyright: Copyright (C) Marcos Casagrande - All Rights Reserved | Todos los derechos reservados
VTEX Flash server, reverse proxy, include files, custom IFs!
Install
After download uncompress the folder.
Enter the folder and run:
:::bash
sudo ./configureYou can change the configuration later on in vf.ini file (See command below)
:::json
{
"root": "/var/www/html/",
"host": "develop-{{environment}}.vtexcommercebeta.com.br",
"liveReload": true,
"mappings": {
"myenvironment": "myenvironmentfolder"
},
"websites": {}
}- root: The root directory where your environments are. VF will retrieve the local files from there.
- host (optional): The host that will be use as reverse proxy. By default {{environment}}.vtexcommercestable.com.br is used. ({{environment}} is a variable, and you should NOT replace it).
- liveReload (optional): Default: false Whether to activate CSS Live Reload or not.
- mappings (optional): By default VTEX Flash will serve files from folders that are the same as the environment, if your environment is example, VF will go to /var/www/html/example if you want it to search in other location, you should map it!
Quick Start
Run this command: (If you reboot your computer/server, it should start automatically)
:::bash
sudo service vtexflash startEdit your hosts file.
:::bash
sudo nano /etc/hostsAnd add the following:
:::bash
#If your are running VTEX Flash in a server, replace 127.0.0.1 with the server IP address
127.0.0.1 example.vtexlocal.com.br example.vtex.com.brNow enter: http://example.vtexlocal.com.br and done!
VTEX Flash will serve CSS & JS files from /var/www/html/example/src/styles && /var/www/html/example/src/js in your local machine / server. You may change the root path or map the environment in vf.ini as explained above
If the file doesn't exist in your server, it will use the one from VTEX if it exists.
Commands
Stop the server
:::bash
sudo service vtexflash stopStart the server
:::bash
sudo service vtexflash startRestart the server
:::bash
sudo service vtexflash restartCheck status
:::bash
sudo service vtexflash statusUpdate
:::bash
sudo vtexflash updateShow errors
:::bash
#sudo vtexflash -l <lines> | default lines: 10
sudo vtexflash -lor
:::bash
#sudo vtexflash --log <lines> | default lines: 10
sudo vtexflash --log 50Edit vf.ini
:::bash
sudo vtexflash -eor
:::bash
sudo vtexflash --editTo create new environment, with presets
:::bash
sudo vtexflash install -e environmentname
cd environmentnameor
:::bash
sudo vtexflash install --env=environmentname
cd environmentnameFeatures
Currently supported:
Custom IF syntax for environments:
:::javascript [IF example-brasil] console.log("This is example-brasil.vtexlocal.com.br!"); [/IF] console.log("This is a global message!"); [IF example-argentina] console.log("This is example-argentina.vtexlocal.com.br!"); [/IF] console.log("Es magicoooo!");
Custom include syntax:
:::javascript [include '/js/my-js.js'] someFunctionInMyJsFile(); //... rest of code
If you have any trouble setting up VTEX flash email me: marcoscvp90@gmail.com
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago