-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5c9621e
commit 945856b
Showing
20 changed files
with
206 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dev: | ||
go run . |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package authenticationRoutes | ||
|
||
import "github.com/gofiber/fiber/v2" | ||
|
||
func ResetPassword(c *fiber.Ctx) error { | ||
return c.Status(200).JSON(&fiber.Map{ | ||
"todo": true, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package authenticationRoutes | ||
|
||
import "github.com/gofiber/fiber/v2" | ||
|
||
func SignIn(c *fiber.Ctx) error { | ||
return c.Status(200).JSON(&fiber.Map{ | ||
"todo": true, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package authenticationRoutes | ||
|
||
import "github.com/gofiber/fiber/v2" | ||
|
||
func SignOut(c *fiber.Ctx) error { | ||
return c.Status(200).JSON(&fiber.Map{ | ||
"todo": true, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package authenticationRoutes | ||
|
||
import "github.com/gofiber/fiber/v2" | ||
|
||
func VerifyEmail(c *fiber.Ctx) error { | ||
return c.Status(200).JSON(&fiber.Map{ | ||
"todo": true, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package healthRoutes | ||
|
||
import "github.com/gofiber/fiber/v2" | ||
|
||
func CheckHealth(c *fiber.Ctx) error { | ||
return c.Status(201).JSON(&fiber.Map{ | ||
"healthy": true, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package main | ||
|
||
import ( | ||
authenticationRoutes "envy-api/authentication/routes" | ||
healthRoutes "envy-api/health/routes" | ||
organisationsRoutes "envy-api/organisations/routes" | ||
projectsRoutes "envy-api/projects/routes" | ||
usersRoutes "envy-api/users/routes" | ||
"log" | ||
|
||
"github.com/gofiber/fiber/v2" | ||
) | ||
|
||
func main() { | ||
app := fiber.New() | ||
|
||
app.Get("/health", healthRoutes.CheckHealth) | ||
|
||
app.Post("/sign-in", authenticationRoutes.SignIn) | ||
app.Post("/sign-out", authenticationRoutes.SignOut) | ||
app.Post("/reset-password", authenticationRoutes.ResetPassword) | ||
app.Post("/verify-email", authenticationRoutes.VerifyEmail) | ||
|
||
app.Post("/users", usersRoutes.CreateUser) | ||
app.Get("/me", usersRoutes.GetMe) | ||
app.Patch("/me", usersRoutes.PatchMe) | ||
|
||
app.Post("/organisations", organisationsRoutes.CreateOrganisation) | ||
app.Get("/organisations/:id", organisationsRoutes.GetOrganisation) | ||
app.Patch("/organisations/:id", organisationsRoutes.PatchOrganisation) | ||
|
||
app.Post("/projects", projectsRoutes.CreateProject) | ||
app.Get("/projects/:id", projectsRoutes.GetProject) | ||
app.Patch("/projects/:id", projectsRoutes.PatchProject) | ||
|
||
log.Fatal(app.Listen(":4000")) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package organisationsRoutes | ||
|
||
import "github.com/gofiber/fiber/v2" | ||
|
||
type Organisation struct { | ||
ID int `json:"id"` | ||
} | ||
|
||
func CreateOrganisation(c *fiber.Ctx) error { | ||
organisation := CreateOrganisationLib() | ||
|
||
return c.Status(201).JSON(&fiber.Map{ | ||
"success": true, | ||
"organisation": organisation, | ||
}) | ||
} | ||
|
||
func CreateOrganisationLib() Organisation { | ||
return Organisation{ID: 1} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package organisationsRoutes | ||
|
||
import "github.com/gofiber/fiber/v2" | ||
|
||
func GetOrganisation(c *fiber.Ctx) error { | ||
return c.Status(200).JSON(&fiber.Map{ | ||
"todo": true, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package organisationsRoutes | ||
|
||
import "github.com/gofiber/fiber/v2" | ||
|
||
func PatchOrganisation(c *fiber.Ctx) error { | ||
return c.Status(201).JSON(&fiber.Map{ | ||
"todo": true, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package projectsRoutes | ||
|
||
import "github.com/gofiber/fiber/v2" | ||
|
||
type Project struct { | ||
ID int `json:"id"` | ||
} | ||
|
||
func CreateProject(c *fiber.Ctx) error { | ||
project := CreateProjectLib() | ||
|
||
return c.Status(201).JSON(&fiber.Map{ | ||
"success": true, | ||
"project": project, | ||
}) | ||
} | ||
|
||
func CreateProjectLib() Project { | ||
return Project{ID: 1} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package projectsRoutes | ||
|
||
import "github.com/gofiber/fiber/v2" | ||
|
||
func GetProject(c *fiber.Ctx) error { | ||
return c.Status(200).JSON(&fiber.Map{ | ||
"todo": true, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package projectsRoutes | ||
|
||
import "github.com/gofiber/fiber/v2" | ||
|
||
func PatchProject(c *fiber.Ctx) error { | ||
return c.Status(201).JSON(&fiber.Map{ | ||
"todo": true, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package usersRoutes | ||
|
||
import "github.com/gofiber/fiber/v2" | ||
|
||
type User struct { | ||
ID int `json:"id"` | ||
} | ||
|
||
func CreateUser(c *fiber.Ctx) error { | ||
user := CreateUserLib() | ||
|
||
return c.Status(201).JSON(&fiber.Map{ | ||
"success": true, | ||
"user": user, | ||
}) | ||
} | ||
|
||
func CreateUserLib() User { | ||
return User{ID: 1} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package usersRoutes | ||
|
||
import "github.com/gofiber/fiber/v2" | ||
|
||
func GetMe(c *fiber.Ctx) error { | ||
return c.Status(200).JSON(&fiber.Map{ | ||
"todo": true, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package usersRoutes | ||
|
||
import "github.com/gofiber/fiber/v2" | ||
|
||
func PatchMe(c *fiber.Ctx) error { | ||
return c.Status(201).JSON(&fiber.Map{ | ||
"todo": true, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters