Skip to content

Commit

Permalink
Rearrange the everything
Browse files Browse the repository at this point in the history
  • Loading branch information
danharasymiw committed Mar 28, 2024
1 parent 3590c2d commit 7791743
Show file tree
Hide file tree
Showing 50 changed files with 439 additions and 371 deletions.
5 changes: 3 additions & 2 deletions .air.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ root = "."
tmp_dir = "bin"

[build]
bin = "./bin/main"
cmd = "go build -o ./bin/main ./cmd/http/main.go"
bin = "./bin/main server"
args_bin = ["server"]
cmd = "go build -o ./bin/main main.go"

delay = 1000
exclude_dir = ["bin", "cmd", "public"]
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/js_ci.yaml

This file was deleted.

72 changes: 0 additions & 72 deletions cmd/scraper/main.go

This file was deleted.

49 changes: 0 additions & 49 deletions internal/handlers/get_user_comments.go

This file was deleted.

95 changes: 0 additions & 95 deletions internal/handlers/get_users.go

This file was deleted.

5 changes: 0 additions & 5 deletions internal/ui/components/no_results.templ

This file was deleted.

15 changes: 0 additions & 15 deletions internal/ui/views/users.templ

This file was deleted.

2 changes: 1 addition & 1 deletion localdev/db/populate.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"
"time"

stor "github.com/salt-today/salttoday2/internal/store"
stor "github.com/salt-today/salttoday2/pkg/store"
)

func main() {
Expand Down
38 changes: 38 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package main

import (
"flag"
"fmt"

"github.com/sirupsen/logrus"

"github.com/salt-today/salttoday2/pkg/scraper"
"github.com/salt-today/salttoday2/pkg/server"
)

func main() {
flag.Usage = func() {
fmt.Println("\nSalttoday scrapes comments from various news sites and displays them.")
fmt.Println("\nUsage:")
fmt.Println("\n\tsalttoday <command> [arguments]")
fmt.Println("\nCommands:")
fmt.Println(` server Runs the HTTP server`)
fmt.Println(` scraper Runs the scraper to collect and store comments`)
fmt.Println()
}
flag.Parse()

switch flag.Arg(0) {
case `server`:
server.Main()
case `scraper`:
scraper.Main()
default:
if len(flag.Arg(0)) == 0 {
logrus.Error(`command not provided`)
} else {
logrus.Errorf(`%q is not a valid command.`, flag.Arg(0))
}
flag.Usage()
}
}
Loading

0 comments on commit 7791743

Please sign in to comment.