Sample bare-bones frontend with relevant tooling
.env
files are used for configuration. The following priority is used:
prod.env
dev.env
local.env
prod.env
and dev.env
are not checked into source control. local.env
is checked in, but should not be used in production.
npm run build
- Build everythingnpm run build-css
- Build only the CSSnpm run build-pack
- Build only the JSnpm run build-tsc
- Build only the webservernpm run build-dev
- Build only CSS and client-side JS
npm run start
- Starts the webservernpm run watch
- Starts the webserver and restarts on changesnpm run dev
- Rebuilts client-side files and starts the webserver
- Clone this repo using
git clone [email protected]:GTDEHacklah23/SampleWeb.git
- Install dependencies using
npm install
- Create a
dev.env
file with the following contents:
HTTP_PORT = 80
HTTPS_PORT = 443
KEY_PATH="path-to-certificates"
ENVIROMENT = "dev"
KEY_PATH
is the path to the directory containing thekey.pem
andcert.pem
files. If it is not present, the server will only serve HTTP
- Compile evertyhing using
npm run build
- Start the server using
npm start
Go to http://localhost:80 (HTTP) or https://localhost:443 (HTTPS) to see the site.
When you are working on client-side code, you can use npm run dev
instead to automatically rebuild the client-side code and restart the server.