-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from Shivam010/dev
feat: Makefile introduced, tests added
- Loading branch information
Showing
8 changed files
with
306 additions
and
37 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
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,22 @@ | ||
GO = GO111MODULE=on go | ||
|
||
fmt: | ||
${GO} fmt ./... | ||
|
||
vet: fmt | ||
${GO} vet ./... | ||
|
||
clean: vet | ||
rm -rf ./bin | ||
${GO} mod tidy | ||
|
||
build: clean | ||
${GO} build -o ./bin/bypass-cors ./... | ||
|
||
test: build | ||
${GO} test -v -cover ./... | ||
|
||
run: clean | ||
${GO} run ./... -p 80 | ||
|
||
.PHONY: run build clean vet fmt |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
github.com/rs/cors v1.6.0 h1:G9tHG9lebljV9mfp9SNPDL36nCDxmo3zTlAf1YgvzmI= | ||
github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= | ||
github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= | ||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= |
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,24 @@ | ||
package main | ||
|
||
import ( | ||
"flag" | ||
) | ||
|
||
const ( | ||
shortHand = " (short hand)" | ||
|
||
defaultPort = "8080" | ||
usagePort = "PORT at which the server will run" | ||
) | ||
|
||
var ( | ||
// PORT at which the server will run (default: 8080), | ||
// can be modified using flags: | ||
// `-port 80` or `-p 80` | ||
PORT string | ||
) | ||
|
||
func init() { | ||
flag.StringVar(&PORT, "port", defaultPort, usagePort) | ||
flag.StringVar(&PORT, "p", defaultPort, usagePort+shortHand) | ||
} |
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
Oops, something went wrong.