sudo sh -c "$(curl -fsSL https://raw.githubusercontent.com/ftd-lang/fpm/main/install-fpm.sh)"
This installs fpm
in /usr/local/bin/fpm
. If you are curious this is the source code of fpm-install.sh.
Alternately, you can go to the FPM Releases Page and download the fpm binary for your platform from the latest release as well.
We support recent versions of Linux, Mac and Windows.
To test if the installation worked, run:
fpm
to see if its workingfpm
And it will show you the fpm help text. Shout out to let everyone know when you are done with this step.
If you get an error message in chat or speak up.
Note: If you have not yet cloned ftd-lang/ftd-workshop
repo as mentioned in workshop basics, please do it now: git clone https://github.com/ftd-lang/ftd-workshop.git
.
FTD files are organized in FPM as a “fpm package”. This is like npm package
for JavaScript or cargo crate
for Rust.
A FPM package is a folder containing a file named FPM.ftd
and some FTD files.
If you run fpm serve
right now and go to http://127.0.0.1:8000 it will fail with message in terminal saying FPM.ftd file is missing.
Lets fix this by creating a FPM.ftd
file with the following content:
FPM.ftd
file-- import: fpm -- fpm.package: hello
We have “imported” fpm, a special ftd module
(each ftd file is called a fpm module
, the way we call .py
files python modules
).
We have created an instance of fpm.package
and passed hello
as the name of the package.
Now if you run fpm serve
it will pick up FPM.ftd
and when you go to the server address (http://127.0.0.1:8000 by default), you will see an empty page.
Congrats, you have created your first FPM package!
You have installed fpm and created your first fpm package. Good job!
Move to learning about booleans now or back to the workshop page.