routes.js 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. const users = [{
  2. id: 1,
  3. name: "Richard Hendricks",
  4. email: "richard@piedpiper.com",
  5. },
  6. {
  7. id: 2,
  8. name: "Bertram Gilfoyls",
  9. email: "gilfoyle@piedpiper.com",
  10. },
  11. ];
  12. // Router
  13. const router = app => {
  14. app.get('/', (request, response) => {
  15. response.send({
  16. "0": {
  17. "temp": "18",
  18. "icon": "blackRain"
  19. },
  20. "1": {
  21. "temp": "18",
  22. "icon": "blackRain"
  23. },
  24. "2": {
  25. "temp": "18",
  26. "icon": "blackRain"
  27. },
  28. "3": {
  29. "temp": "18",
  30. "icon": "blackRain"
  31. },
  32. "4": {
  33. "temp": "18",
  34. "icon": "blackRain"
  35. },
  36. "5": {
  37. "temp": "18",
  38. "icon": "blackRain"
  39. },
  40. "6": {
  41. "temp": "18",
  42. "icon": "blackRain"
  43. },
  44. "7": {
  45. "temp": "19",
  46. "icon": "sun"
  47. },
  48. "8": {
  49. "temp": "19",
  50. "icon": "sun"
  51. },
  52. "9": {
  53. "temp": "20",
  54. "icon": "sun"
  55. },
  56. "10": {
  57. "temp": "21",
  58. "icon": "sun"
  59. },
  60. "11": {
  61. "temp": "22",
  62. "icon": "sun"
  63. },
  64. "12": {
  65. "temp": "22",
  66. "icon": "sun"
  67. },
  68. "13": {
  69. "temp": "23",
  70. "icon": "sun"
  71. },
  72. "14": {
  73. "temp": "25",
  74. "icon": "sun"
  75. },
  76. "15": {
  77. "temp": "27",
  78. "icon": "sun"
  79. },
  80. "16": {
  81. "temp": "27",
  82. "icon": "cloudy"
  83. },
  84. "17": {
  85. "temp": "25",
  86. "icon": "cloudy"
  87. },
  88. "18": {
  89. "temp": "24",
  90. "icon": "cloudy"
  91. },
  92. "19": {
  93. "temp": "22",
  94. "icon": "cloudy"
  95. },
  96. "20": {
  97. "temp": "22",
  98. "icon": "cloudy"
  99. },
  100. "21": {
  101. "temp": "21",
  102. "icon": "blackCloudy"
  103. },
  104. "22": {
  105. "temp": "18",
  106. "icon": "blackCloudy"
  107. },
  108. "23": {
  109. "temp": "18",
  110. "icon": "blackCloudy"
  111. },
  112. "_id": {
  113. "$oid": "5f2075c01df7d5417c805809"
  114. },
  115. "minTemp": "18",
  116. "maxTemp": "27"
  117. });
  118. });
  119. app.get('/kiyv', (request, response) => {
  120. response.send(
  121. {
  122. "0": {
  123. "temp": "18",
  124. "icon": "blackRain"
  125. },
  126. "1": {
  127. "temp": "18",
  128. "icon": "blackRain"
  129. },
  130. "2": {
  131. "temp": "18",
  132. "icon": "blackRain"
  133. },
  134. "3": {
  135. "temp": "18",
  136. "icon": "blackRain"
  137. },
  138. "4": {
  139. "temp": "18",
  140. "icon": "blackRain"
  141. },
  142. "5": {
  143. "temp": "18",
  144. "icon": "blackRain"
  145. },
  146. "6": {
  147. "temp": "18",
  148. "icon": "blackRain"
  149. },
  150. "7": {
  151. "temp": "19",
  152. "icon": "sun"
  153. },
  154. "8": {
  155. "temp": "19",
  156. "icon": "sun"
  157. },
  158. "9": {
  159. "temp": "20",
  160. "icon": "sun"
  161. },
  162. "10": {
  163. "temp": "21",
  164. "icon": "sun"
  165. },
  166. "11": {
  167. "temp": "22",
  168. "icon": "sun"
  169. },
  170. "12": {
  171. "temp": "22",
  172. "icon": "sun"
  173. },
  174. "13": {
  175. "temp": "23",
  176. "icon": "sun"
  177. },
  178. "14": {
  179. "temp": "25",
  180. "icon": "sun"
  181. },
  182. "15": {
  183. "temp": "27",
  184. "icon": "sun"
  185. },
  186. "16": {
  187. "temp": "27",
  188. "icon": "cloudy"
  189. },
  190. "17": {
  191. "temp": "25",
  192. "icon": "cloudy"
  193. },
  194. "18": {
  195. "temp": "24",
  196. "icon": "cloudy"
  197. },
  198. "19": {
  199. "temp": "22",
  200. "icon": "cloudy"
  201. },
  202. "20": {
  203. "temp": "22",
  204. "icon": "cloudy"
  205. },
  206. "21": {
  207. "temp": "21",
  208. "icon": "blackCloudy"
  209. },
  210. "22": {
  211. "temp": "18",
  212. "icon": "blackCloudy"
  213. },
  214. "23": {
  215. "temp": "18",
  216. "icon": "blackCloudy"
  217. },
  218. "_id": {
  219. "$oid": "5f2075c01df7d5417c805809"
  220. },
  221. "minTemp": "18",
  222. "maxTemp": "27"
  223. }
  224. );
  225. });
  226. app.get('/users', (request, response) => {
  227. response.send(users);
  228. });
  229. }
  230. // Export the router
  231. module.exports = router;