Skip to content

Commit

Permalink
Update vercel configuration & repo structure
Browse files Browse the repository at this point in the history
  • Loading branch information
elsesiy committed Jan 16, 2023
1 parent 1861369 commit 6a99317
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 34 deletions.
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM golang:1.13 AS build-env
FROM golang:1.18 AS build-env

WORKDIR /qrgo
COPY qrgo.go go.mod go.sum ./
COPY main ./main
COPY main.go go.mod go.sum ./
COPY api ./api

RUN bash -c "go mod download &> /dev/null"

RUN CGO_ENABLED=0 GOOS=linux go build -o app -ldflags "-s -w" ./main
RUN CGO_ENABLED=0 GOOS=linux go build -o app -ldflags "-s -w" ./

FROM gcr.io/distroless/static:latest
FROM gcr.io/distroless/static:nonroot
COPY --from=build-env /qrgo/app .
CMD ["./app"]
CMD ["./app"]
3 changes: 2 additions & 1 deletion qrgo.go → api/qrgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import (
"encoding/base64"
"errors"
"fmt"
"github.com/skip2/go-qrcode"
"html/template"
"net/http"
"net/url"
"strings"

"github.com/skip2/go-qrcode"
)

// ErrMissingParam is returned if path param evaluation results empty
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module elsesiy/qrgo
module github.com/elsesiy/qrgo

go 1.13
go 1.18

require github.com/skip2/go-qrcode v0.0.0-20191027152451-9434209cb086
require github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
github.com/skip2/go-qrcode v0.0.0-20190110000554-dc11ecdae0a9 h1:lpEzuenPuO1XNTeikEmvqYFcU37GVLl8SRNblzyvGBE=
github.com/skip2/go-qrcode v0.0.0-20190110000554-dc11ecdae0a9/go.mod h1:PLPIyL7ikehBD1OAjmKKiOEhbvWyHGaNDjquXMcYABo=
github.com/skip2/go-qrcode v0.0.0-20191027152451-9434209cb086 h1:RYiqpb2ii2Z6J4x0wxK46kvPBbFuZcdhS+CIztmYgZs=
github.com/skip2/go-qrcode v0.0.0-20191027152451-9434209cb086/go.mod h1:PLPIyL7ikehBD1OAjmKKiOEhbvWyHGaNDjquXMcYABo=
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e h1:MRM5ITcdelLK2j1vwZ3Je0FKVCfqOLp5zO6trqMLYs0=
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e/go.mod h1:XV66xRDqSt+GTGFMVlhk3ULuV0y9ZmzeVGR4mloJI3M=
3 changes: 2 additions & 1 deletion main/main.go → main.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package main

import (
"elsesiy/qrgo"
"log"
"net/http"
"os"

qrgo "github.com/elsesiy/qrgo/api"
)

func main() {
Expand Down
19 changes: 0 additions & 19 deletions now.json

This file was deleted.

18 changes: 18 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": 2,
"build": {
"env": {
"GO_BUILD_FLAGS": "-ldflags '-s -w'"
}
},
"rewrites": [
{
"source": "/(.*)",
"destination": "/api/qrgo.go"
},
{
"source": "/",
"destination": "/api/qrgo.go"
}
]
}

1 comment on commit 6a99317

@vercel
Copy link

@vercel vercel bot commented on 6a99317 Jan 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

qrgo – ./

qrgo-git-master-elsesiy.vercel.app
qrgo-elsesiy.vercel.app

Please sign in to comment.