Skip to content

Commit adf875e

Browse files
committed
2 parents ca79850 + 23fa9fb commit adf875e

File tree

3 files changed

+4
-40
lines changed

3 files changed

+4
-40
lines changed

README.md

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
This repo contains the starter code for the "Notely" application for the "Learn CICD" course on [Boot.dev](https://boot.dev).
44

5-
This README is for reference purposes only! Follow the instructions in the course, don't start doing all the steps here in the README.
6-
75
## Local Development
86

97
Make sure you're on Go version 1.20+.
@@ -20,40 +18,6 @@ Run the server:
2018
go build -o notely && ./notely
2119
```
2220

23-
*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.
24-
25-
## Database Setup
26-
27-
This project uses a MySQL database for persistent storage. You can install MySQL locally for local development, or connect to a remote database.
28-
29-
Add *your* database connection string to your `.env` file. Here's an example:
30-
31-
```bash
32-
DATABASE_URL="username:password@host/dbname?tls=true"
33-
```
34-
35-
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:
36-
37-
```bash
38-
go install github.com/pressly/goose/v3/cmd/goose@latest
39-
```
40-
41-
Then run the migrations:
42-
43-
```bash
44-
./scripts/migrateup.sh
45-
```
46-
47-
Start the server:
48-
49-
```bash
50-
go build -o notely && ./notely
51-
```
52-
53-
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:
54-
55-
* Create a user (login as that user)
56-
* Save notes
57-
* Logout (To log in again you'll just create a new user)
21+
*This starts the server in non-database mode.* It will serve a simple webpage at `http://localhost:8000`.
5822

59-
*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.*
23+
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!

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var staticFiles embed.FS
2929
func main() {
3030
err := godotenv.Load(".env")
3131
if err != nil {
32-
log.Fatalf("Error loading .env file: %v", err)
32+
log.Printf("warning: assuming default configuration. .env unreadable: %v", err)
3333
}
3434

3535
port := os.Getenv("PORT")

static/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</head>
88

99
<body class="section">
10-
<h1>Welcome to Notely</h1>
10+
<h1>Notely</h1>
1111

1212
<div id="userCreationContainer" class="section">
1313
<input id="nameField" type="text" placeholder="Enter your name">

0 commit comments

Comments
 (0)