Skip to content

Commit 3a0688f

Browse files
authored
Merge branch 'master' into deps-new
2 parents 0c3e044 + 0d0ac58 commit 3a0688f

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

config/config.go.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const GroupsURL = "http://localhost:9001"
1818
const HardwareURL = "http://localhost:4523/api/v1.0"
1919
const MemesURL = "http://localhost:42069"
2020
const MerchURL = "http://localhost:6969"
21+
const NotificationURL = "http://localhost:1122"
2122
const QuotesURL = "http://localhost:9494"
2223
const RecruiterURL = "http://localhost:4567"
2324
const UsersURL = "http://localhost:8001"

services/notification.go

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/**
2+
* Copyright © 2017, ACM@UIUC
3+
*
4+
* This file is part of the Groot Project.
5+
*
6+
* The Groot Project is open source software, released under the University of
7+
* Illinois/NCSA Open Source License. You should have received a copy of
8+
* this license in a file with the distribution.
9+
**/
10+
11+
package services
12+
13+
import (
14+
"net/http"
15+
16+
"github.com/acm-uiuc/arbor"
17+
"github.com/acm-uiuc/groot-api-gateway/config"
18+
)
19+
20+
//Location
21+
const NotificationURL string = config.NotificationURL
22+
23+
//Service Data Type
24+
const NotificationFormat string = "JSON"
25+
26+
//API Interface
27+
var NotificationRoutes = arbor.RouteCollection{
28+
arbor.Route{
29+
"PostNotification",
30+
"POST",
31+
"/notification",
32+
PostNotification,
33+
},
34+
}
35+
36+
// arbor.Route handler
37+
func PostNotification(w http.ResponseWriter, r *http.Request) {
38+
arbor.POST(w, NotificationURL+r.URL.String(), NotificationFormat, "", r)
39+
}

services/services.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ func RegisterAPIs() arbor.RouteCollection {
3939
Routes = append(Routes, HardwareRoutes...)
4040
Routes = append(Routes, MemeRoutes...)
4141
Routes = append(Routes, MerchRoutes...)
42+
Routes = append(Routes, NotificationRoutes...)
4243
Routes = append(Routes, QuotesRoutes...)
4344
Routes = append(Routes, RecruitersRoutes...)
4445
Routes = append(Routes, UsersRoutes...)

0 commit comments

Comments
 (0)