Advertisement
Guest User

testPD

a guest
Jul 18th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. make an REST API endpoint using nodejs (any framework) that will recieve an integer param. And the response should be a JSON with string of number from 1 until input that separated by comma.
  2. but for each multiple of 3, it will concat "Pesta" instead of the number.
  3. but for each multiple of 7, it will concat "Diskon" instead of the number.
  4. and for each multipleof of both 3 and 7, it will concat "PestaDiskon" instead of the number
  5.  
  6. example:
  7.  
  8. input:
  9. cURL http://localhost:3000/test/23
  10.  
  11. response:
  12. {
  13. output:"1,2,Pesta,4,5,Pesta,Diskon,8,Pesta,10,11,Pesta,13,Diskon,Pesta,16,17,Pesta,19,20,PestaDiskon,22,23,"
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement