Преглед изворни кода

- Use GET over POST since results are idempotent

Brett Zamir пре 6 година
родитељ
комит
7081b499ff
2 измењених фајлова са 6 додато и 6 уклоњено
  1. 4 4
      README.md
  2. 2 2
      api/routes/bDateRoutes.js

+ 4 - 4
README.md

@@ -2,13 +2,13 @@
 
 So far, there are two endpoints for this API:
 
-**GET /today**
+**POST /today**
 
-Returns today's date according to the Baháʼí/Badí' calendar.
+Returns today's date according to the Baháʼí/Badí' calendar via POST request.
 
-**POST /date**
+**GET /date**
 
-Given a date from the Gregorian calendar defined via POST data, returns the corresponding date in the Baháʼí calendar.
+Given a date from the Gregorian calendar defined via GET data, returns the corresponding date in the Baháʼí calendar.
 
 ## Running
 

+ 2 - 2
api/routes/bDateRoutes.js

@@ -7,8 +7,8 @@ module.exports = function(app) {
     .get(bDate.test);
   // Today's Badi date
   app.route('/today')
-    .get(bDate.today);
+    .post(bDate.today);
   // Arbitrary Badi date
   app.route('/date')
-    .post(bDate.date);
+    .get(bDate.date);
 };