Skip to content

Commit

Permalink
added main function
Browse files Browse the repository at this point in the history
Signed-off-by: viveksahu26 <vivekkumarsahu650@gmail.com>
  • Loading branch information
viveksahu26 committed Sep 14, 2022
0 parents commit 18cee53
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# url_shortner
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/viveksahu26/url_shortner

go 1.19
18 changes: 18 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package main

import (
"fmt"
"net/http"
)

func main() {
fmt.Println("URL Shorten Service")

// handleShortUrl function mapped to /short-url
http.HandleFunc("/short-url", handleShortUrl)

err := http.ListenAndServe(":8080", nil)
if err != nil {
panic(err)
}
}

0 comments on commit 18cee53

Please sign in to comment.