Webstore-Backend.st 553 B

1234567891011121314151617181920212223
  1. Smalltalk createPackage: 'Webstore-Backend'!
  2. Object subclass: #WebstoreBackend
  3. slots: {}
  4. package: 'Webstore-Backend'!
  5. !WebstoreBackend methodsFor: 'lambda api'!
  6. echoEvent: event andContext: context
  7. ^ #{
  8. #statusCode -> 200.
  9. #headers->#{'Access-Control-Allow-Origin' -> '*'}.
  10. #body -> (JSON stringify: #{#event -> event. #context -> context})
  11. }
  12. !
  13. status
  14. ^ #{
  15. #statusCode -> 200.
  16. #headers->#{'Access-Control-Allow-Origin' -> '*'}.
  17. #body -> (JSON stringify: #{#ok -> true. #amber -> Smalltalk version. #node -> process version})
  18. }
  19. ! !