Procházet zdrojové kódy

- Use GET over POST since results are idempotent

Brett Zamir před 6 roky
rodič
revize
7081b499ff
2 změnil soubory, kde provedl 6 přidání a 6 odebrání
  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);
 };