You can save your *.star
anywhere on your system. On my computer, I have a projects folder with sub-folders to hold files for various projects.
As for knowing where pixlet is installed, you shouldn’t need to worry about that as homebrew installs it in a location that is typically already added to your PATH
variable. In my case, pixlet was installed in /usr/local/bin
:
**********@*****-Mac-mini ~ % echo $PATH
/Users/**********/.nvm/versions/node/v16.4.2/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/Library/Apple/usr/bin
**********@*****-Mac-mini ~ % which pixlet
/usr/local/bin/pixlet
**********@*****-Mac-mini ~ %
Once you have saved your *.star
file, let’s say you called it my_app.star
:
- Open a terminal window and navigate to the folder where you have the file stored
- Run the following command,
pixlet serve my_app.star
- The output from step 2 should look something like the following if there are no errors. If there are errors reported, it will output the error which you’ll need to fix and try again:
2022/07/02 15:25:51 listening at http://127.0.0.1:8080
- Open a browser window and go to the URL
http://127.0.0.1:8080
and you should see the output of your tidbyt app.
Note: If you want the browser to auto refresh when you save a change to your app run this command instead:
pixlet serve --watch my_app.star
So long as there are no errors with the changes you saved, the app will auto-refresh, if there is an error with your app, the error will be displayed in the terminal window. FIx the error and the app will auto update, rinse and repeat.