@@ -28,28 +28,29 @@ import (
2828)
2929
3030func Start (embeddedFiles fs.FS ) {
31+ apiBase := "/api"
3132 router := gin .Default ()
3233 router .Use (gzip .Gzip (gzip .DefaultCompression ))
33- router .POST ("/appuser/signin" , postSignin )
34- router .POST ("/appuser/login" , postLogin )
35- router .GET ("/appuser/logout" , token .CheckToken , getLogout )
36- router .GET ("/appuser/location" , token .CheckToken , getLocation )
37- router .GET ("/appuser/refreshtoken" , token .CheckToken , getRefreshToken )
38- router .POST ("/appuser/locationradius" , token .CheckToken , postUserLocationRadius )
39- router .POST ("/appuser/targetprices" , token .CheckToken , postTargetPrices )
40- router .GET ("/config/updategs" , token .CheckToken , gsclient .UpdateGasStations )
41- router .GET ("/config/updatepc" , token .CheckToken , getPostCodeCoordinates )
42- router .GET ("/config/updatestatescounties" , token .CheckToken , getStateCountyData )
43- router .GET ("/config/recalcAvgs" , token .CheckToken , getRecalcAvgs )
44- router .GET ("/gasprice/:id" , token .CheckToken , getGasPriceByGasStationId )
45- router .GET ("/gasstation/:id" , token .CheckToken , getGasStationById )
46- router .GET ("/gasprice/avgs/:postcode" , token .CheckToken , getAveragePrices )
47- router .POST ("/gasstation/search/place" , token .CheckToken , searchGasStationPlace )
48- router .POST ("/gasstation/search/location" , token .CheckToken , searchGasStationLocation )
49- router .GET ("/usernotification/new/:useruuid" , token .CheckToken , getNewUserNotifications )
50- router .GET ("/usernotification/current/:useruuid" , token .CheckToken , getCurrentUserNotifications )
51- router .GET ("/postcode/countytimeslots/:postcode" , token .CheckToken , getCountyDataByIdWithTimeSlots )
52- router .GET ("/gasstation/countytimeslots/recalc" , token .CheckToken , getRecalcTimeSlots )
34+ router .POST (apiBase + "/appuser/signin" , postSignin )
35+ router .POST (apiBase + "/appuser/login" , postLogin )
36+ router .GET (apiBase + "/appuser/logout" , token .CheckToken , getLogout )
37+ router .GET (apiBase + "/appuser/location" , token .CheckToken , getLocation )
38+ router .GET (apiBase + "/appuser/refreshtoken" , token .CheckToken , getRefreshToken )
39+ router .POST (apiBase + "/appuser/locationradius" , token .CheckToken , postUserLocationRadius )
40+ router .POST (apiBase + "/appuser/targetprices" , token .CheckToken , postTargetPrices )
41+ router .GET (apiBase + "/config/updategs" , token .CheckToken , gsclient .UpdateGasStations )
42+ router .GET (apiBase + "/config/updatepc" , token .CheckToken , getPostCodeCoordinates )
43+ router .GET (apiBase + "/config/updatestatescounties" , token .CheckToken , getStateCountyData )
44+ router .GET (apiBase + "/config/recalcAvgs" , token .CheckToken , getRecalcAvgs )
45+ router .GET (apiBase + "/gasprice/:id" , token .CheckToken , getGasPriceByGasStationId )
46+ router .GET (apiBase + "/gasstation/:id" , token .CheckToken , getGasStationById )
47+ router .GET (apiBase + "/gasprice/avgs/:postcode" , token .CheckToken , getAveragePrices )
48+ router .POST (apiBase + "/gasstation/search/place" , token .CheckToken , searchGasStationPlace )
49+ router .POST (apiBase + "/gasstation/search/location" , token .CheckToken , searchGasStationLocation )
50+ router .GET (apiBase + "/usernotification/new/:useruuid" , token .CheckToken , getNewUserNotifications )
51+ router .GET (apiBase + "/usernotification/current/:useruuid" , token .CheckToken , getCurrentUserNotifications )
52+ router .GET (apiBase + "/postcode/countytimeslots/:postcode" , token .CheckToken , getCountyDataByIdWithTimeSlots )
53+ router .GET (apiBase + "/gasstation/countytimeslots/recalc" , token .CheckToken , getRecalcTimeSlots )
5354
5455 myPort := strings .TrimSpace (os .Getenv ("PORT" ))
5556 portNum , err := strconv .ParseInt (myPort , 10 , 0 )
0 commit comments