From de9122f73ddb359d7cc6e87af1d12f11b034a6f4 Mon Sep 17 00:00:00 2001 From: Andrew Pennebaker Date: Wed, 5 Jul 2023 14:41:33 -0500 Subject: [PATCH 1/5] warn rather than bail on missing config file --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 47a6774..adb661f 100644 --- a/main.go +++ b/main.go @@ -29,7 +29,7 @@ var staticFiles embed.FS func main() { err := godotenv.Load(".env") if err != nil { - log.Fatalf("Error loading .env file: %v", err) + log.Printf("Error loading .env file: %v", err) } port := os.Getenv("PORT") From 6188cd27f5d162159a442921b962c56e07cc9541 Mon Sep 17 00:00:00 2001 From: Andrew Pennebaker Date: Wed, 5 Jul 2023 14:45:48 -0500 Subject: [PATCH 2/5] update missing config file message --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index adb661f..fbef345 100644 --- a/main.go +++ b/main.go @@ -29,7 +29,7 @@ var staticFiles embed.FS func main() { err := godotenv.Load(".env") if err != nil { - log.Printf("Error loading .env file: %v", err) + log.Printf("warning: assuming default configuration. .env unreadable: %v", err) } port := os.Getenv("PORT") From 9a73b32471ac8a76d8f0b5413b40a7ae820034a4 Mon Sep 17 00:00:00 2001 From: Andrew Pennebaker Date: Thu, 6 Jul 2023 10:28:04 -0500 Subject: [PATCH 3/5] match expected starting code state for learn ci/cd ch7ass5-custom_cd --- static/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/index.html b/static/index.html index 5d4ad73..72be101 100644 --- a/static/index.html +++ b/static/index.html @@ -7,7 +7,7 @@ -

Welcome to Notely

+

Notely

From a4c32fdbd8ea1d0b9a7f60dcfdaea1df87f1789c Mon Sep 17 00:00:00 2001 From: Lane Wagner Date: Sun, 9 Jul 2023 14:17:02 -0600 Subject: [PATCH 4/5] Update README.md --- README.md | 40 ++-------------------------------------- 1 file changed, 2 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index c900296..f9816d0 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,6 @@ This repo contains the starter code for the "Notely" application for the "Learn CICD" course on [Boot.dev](https://boot.dev). -This README is for reference purposes only! Follow the instructions in the course, don't start doing all the steps here in the README. - ## Local Development Make sure you're on Go version 1.20+. @@ -20,40 +18,6 @@ Run the server: go build -o notely && ./notely ``` -*This starts the server in non-database mode.* It will serve a webpage at `http://localhost:8000`. However, you won't be able to interact with the webpage until you connect it to a MySQL database and run the migrations. +*This starts the server in non-database mode.* It will serve a simple webpage at `http://localhost:8000`. -## Database Setup - -This project uses a MySQL database for persistent storage. You can install MySQL locally for local development, or connect to a remote database. - -Add *your* database connection string to your `.env` file. Here's an example: - -```bash -DATABASE_URL="username:password@host/dbname?tls=true" -``` - -Once you have an empty database, you'll need to run migrations to create the schema. Make sure you have [goose](https://github.com/pressly/goose) installed: - -```bash -go install github.com/pressly/goose/v3/cmd/goose@latest -``` - -Then run the migrations: - -```bash -./scripts/migrateup.sh -``` - -Start the server: - -```bash -go build -o notely && ./notely -``` - -Because the `DATABASE_URL` environment variable is set, the server will connect to the database and serve the webpage at `http://localhost:8000`. The page should be fully functional now. You can: - -* Create a user (login as that user) -* Save notes -* Logout (To log in again you'll just create a new user) - -*The purpose of this project is to just be a simple CRUD app that we can use to practice CI/CD. It's not meant to be a fully functional app.* +You do not need to set up a database and any interactivity on the page yet. Instructions for that will come later in the course! From 23fa9fb37715afa8cb7c5cf73a3816dc9841a2cb Mon Sep 17 00:00:00 2001 From: Lane Wagner Date: Sun, 9 Jul 2023 14:18:47 -0600 Subject: [PATCH 5/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f9816d0..898e717 100644 --- a/README.md +++ b/README.md @@ -20,4 +20,4 @@ go build -o notely && ./notely *This starts the server in non-database mode.* It will serve a simple webpage at `http://localhost:8000`. -You do not need to set up a database and any interactivity on the page yet. Instructions for that will come later in the course! +You do *not* need to set up a database or any interactivity on the webpage yet. Instructions for that will come later in the course!