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
package middleware | |
import ( | |
"fmt" | |
"log" | |
"os" | |
"github.com/gin-contrib/sessions" | |
"github.com/gin-contrib/sessions/redis" | |
"github.com/gin-gonic/gin" |
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
# The manifest for the "admin" service. | |
# Read the full specification for the "Request-Driven Web Service" type at: | |
# https://aws.github.io/copilot-cli/docs/manifest/rd-web-service/ | |
# Your service name will be used in naming your resources like log groups, App Runner services, etc. | |
name: admin | |
# The "architecture" of the service you're running. | |
type: Request-Driven Web Service | |
image: |
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
# The manifest for the "admin" service. | |
# Read the full specification for the "Request-Driven Web Service" type at: | |
# https://aws.github.io/copilot-cli/docs/manifest/rd-web-service/ | |
# Your service name will be used in naming your resources like log groups, App Runner services, etc. | |
name: admin | |
# The "architecture" of the service you're running. | |
type: Request-Driven Web Service | |
image: |
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
Parameters: | |
App: | |
Type: String | |
Description: Your application's name. | |
Env: | |
Type: String | |
Description: The environment name your service, job, or workflow is being deployed to. | |
Name: | |
Type: String | |
Description: The name of the service, job, or workflow being deployed. |
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
FROM golang:1.18 | |
WORKDIR /usr/src/app | |
# pre-fetch the dependencies in a separate layer | |
COPY go.mod go.sum ./ | |
RUN go mod download && go mod verify | |
# copy in the full codebase and build | |
COPY . . |
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
package main | |
import ( | |
"github.com/gin-gonic/gin" | |
"github.com/jsonw23/copilot-react-admin/middleware" | |
) | |
func main() { | |
r := gin.Default() |
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
package middleware | |
import ( | |
"github.com/gin-contrib/sessions" | |
"github.com/gin-contrib/sessions/cookie" | |
"github.com/gin-gonic/gin" | |
) | |
func Auth(r *gin.Engine) gin.HandlerFunc { | |
store := cookie.NewStore([]byte("secret")) |
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
package main | |
import "github.com/gin-gonic/gin" | |
func main() { | |
r := gin.Default() | |
r.GET("/", func(c *gin.Context) { | |
c.JSON(200, gin.H{ | |
"message": "Hello, World", |
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
Globals: | |
Function: | |
Timeout: 3 | |
Api: | |
# this one weird trick... | |
OpenApiVersion: 3.0.3 |
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
Outputs: | |
HelloWorldFunctionApi: | |
Description: "The URL that will trigger our HelloWorldFunction" | |
Value: !Sub "https://${Api}.execute-api.${AWS::Region}.amazonaws.com/${ApiStageName}/hello/" |
NewerOlder