Currently running at https://freeflightwx.com/new/
Install the required npm packages with:
npm install
If you later have trouble with e.g. npm run build
then try changing your node version.
I do this with node version manager (nvm
):
nvm install --lts
nvm use --lts
Start the development server with:
npm run dev
Now navigate a browser to http://localhost:5173 (or whichever port npm run dev
says to use).
npm run build
The web application is now available in the build/
folder.
Make sure you have built first (see above).
The server uses FTP, so I use lftp
like this (changing <username>
, <password>
and <host>
to the correct values:
lftp :~> open ftp://<username>:<password>@<host>
lftp :~> set ftp:ssl-protect-data true
lftp <username>@<host>:/> cd public_html/new
lftp [email protected]:/public_html/new> lcd build
lftp [email protected]:/public_html/new> mirror --reverse --delete --use-cache --verbose --no-perms --no-umask --parallel=2
Note that if you run a new build and still have lftp
open you will need to run lcd ../build
before running the mirror command again.
Also be very certain that you are in public_html/new
, otherwise you will wipe some other directory!
Until I figure out how to automate this, there are several places you need to change:
- Add your site in
src/freeflightwx-sites.ts
(copy and change one of the others), and add it toallSites
in the same file. - Add a mapping from the site's path to its data table in
$data_tables
instatic/fetch.php
. - Add its path to the list of entry points in
svelte.config.js
. - (optional) Add it to
src/routes/+page.svelte
to include it on the home page.
The static/export_sites.php
script needs to be run on the server, like this (assuming it has been uploaded by ftp):
curl -o src/freeflightwx-sites-autogen.ts https://freeflightwx.com/new/export_sites.php
After you have added the individual sites:
- Add your group in
src/freeflightwx-sites.ts
(copy and change one of the others), and add it toallGroups
in the same file. - Add its path to the list of entry points in
svelte.config.js
. - (optional) Add it to
src/routes/+page.svelte
to include it on the home page.