Go stack to start on.
docker build -t web .
docker-compose up # server at :8080
make install
cp .example.env .dev.env
ENV=DEV go run --tags="fts5" main.go . # start server on :8080
Enable SSL by setting HTTP_SSL
to 1
in .*.env
Example with .dev.env
# .dev.env
HTTP_SSL=1
You will need to create a certificate
# interactive
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 365
# non-interactive and 10 years expiration
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 3650 -nodes -subj "/C=XX/ST=StateName/L=CityName/O=CompanyName/OU=CompanySectionName/CN=CommonNameOrHostname"
Known issues:
- tls: failed to parse private key
Then copy
key.unencrypted.pem
tokey.pem
cp key.unencrypted.pem key.pem
ENV=DEV go build --tags="fts5" . # build ./web executable
./web # launch server at :8080
make re-test # delete test database, & reseed
make re-dev # reset dev database, & reseed
Github actions uses go.yml file to execute unit and integration tests.
make # make clean && make install
ENV=TEST go test -tags fts5 -timeout 30s -v ./...
Cypress is used to do E2E tests.
You will need NodeJS and a package manager: pnpm or npm or yarn installed on your computer. Github actions uses e2e.yml file to execute E2E tests. The tests are located under cypress directory.
In a terminal run the server:
ENV=TEST go run --tags="fts5" main.go .
In another terminal run the application
pnpm cypress open
# or
npx cypress open
# or
yarn cypress open
The CLI version does not need you to launch server, however you will need to build the go binary. See build section
Once you have build go binary, launch in terminal
pnpm run ci
# or
npm run ci
# or
yarn ci