mirror of
https://github.com/get-drexa/drive.git
synced 2026-02-02 23:51:18 +00:00
feat: initial backend scaffolding
migrating away from convex Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
22
apps/backend/cmd/drexa/main.go
Normal file
22
apps/backend/cmd/drexa/main.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/get-drexa/drexa/internal/drexa"
|
||||
"github.com/joho/godotenv"
|
||||
)
|
||||
|
||||
func main() {
|
||||
_ = godotenv.Load()
|
||||
|
||||
config, err := drexa.ServerConfigFromEnv()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
server := drexa.NewServer(*config)
|
||||
|
||||
log.Fatal(server.Listen(fmt.Sprintf(":%d", config.Port)))
|
||||
}
|
||||
13
apps/backend/cmd/migration/main.go
Normal file
13
apps/backend/cmd/migration/main.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/get-drexa/drexa/internal/database"
|
||||
)
|
||||
|
||||
func main() {
|
||||
if err := database.RunMigrations(); err != nil {
|
||||
log.Fatalf("Failed to run migrations: %v", err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user