Dear VAST community.
I am having trouble getting my very first, simple RESTful component to work.
- Created a Subclass of WARestfulHandler named CurrentTimeHandler
- Implemented a method called now:
now
<get>
self requestContext respond: [:r|
r contentType: 'text/plain'; nextPutAll: Time now printString
] - Registered the component evaluating
WAADmin register: CurrentTimeHander at: 'api' - Navigated to http://localhost:8080/api
And got an empty page saying:
/api not found
So I started debugging around. At first I tried setting a breakpoint in my method #now, which never fired (not surprising).
Then I debugged into WAREstfulHandler>>#createRoutes and below.
I found that in WARouteBuilder class>>#createRoutesFrom:to:
the collection of Pragmas remained empty. The method CurrentTimeHandler>>#now had no pragmas. ...???????
So I removed the Breakpoint, retried, still no pragmas. So I changed the code by adding a line break, saved the method again and retried. The method had a pragma named #get.
Is that by design? Is there a reason why setting a Breakpoint removes pragmas?
So I removed the Breakpoint, resaved the method, but still got "/api not found".
Can anybody confirm that SeasideRest works on VAST? Can anybody give me a hint as to what I am doing wrong?
Thanks,
Joachim