A first RESTXQ function
Tuesday, 17 November 2020 · 3 messages · last reply 21 Nov 2020
N
Nicholas17 Nov 2020 22:36 #
For this example:
module namespace page = 'http://basex.org/examples/web-page';
declare %rest:path("hello/{$who}") %rest:GET function page:hello($who) {
<response>
<title>Hello { $who }!</title>
</response>};
https://docs.basex.org/wiki/RESTXQ
where/how is this function stored or saved?
thanks,
Nick
CG
Christian Grün19 Nov 2020 10:49 #
Hi Nicholas,
A good start is to:
1. download the full distribution of BaseX
2. run basexhttp,
3. visit http://localhost:8984,
4. open the BaseX GUI and look at the files in the webapp directory.
You can modify some of these files and see what your browser does.
Cheers,
Christian
Quoted text · Nicholas · 27 lines
On Tue, Nov 17, 2020 at 9:36 PM Nicholas <saunders.nicholas at gmail.com> wrote: > > For this example: > > > module namespace page = 'http://basex.org/examples/web-page'; > > declare %rest:path("hello/{$who}") %rest:GET function page:hello($who) { > <response> > <title>Hello { $who }!</title> > </response> > > }; > > > https://docs.basex.org/wiki/RESTXQ > > > where/how is this function stored or saved? > > > > thanks, > > > Nick >
N
Nicholas21 Nov 2020 09:33 #
Hi Christian,
Ah, it's step #3 where I seem to run into a roadblock. I'll look into that more closely.
thanks,
Nick
Quoted text · Christian Grün · 43 lines
On 11/19/20 1:49 AM, Christian Grün wrote: > Hi Nicholas, > > A good start is to: > > 1. download the full distribution of BaseX > 2. run basexhttp, > 3. visit http://localhost:8984, > 4. open the BaseX GUI and look at the files in the webapp directory. > > You can modify some of these files and see what your browser does. > > Cheers, > Christian > > > > On Tue, Nov 17, 2020 at 9:36 PM Nicholas <saunders.nicholas at gmail.com> wrote: >> For this example: >> >> >> module namespace page = 'http://basex.org/examples/web-page'; >> >> declare %rest:path("hello/{$who}") %rest:GET function page:hello($who) { >> <response> >> <title>Hello { $who }!</title> >> </response> >> >> }; >> >> >> https://docs.basex.org/wiki/RESTXQ >> >> >> where/how is this function stored or saved? >> >> >> >> thanks, >> >> >> Nick >>
Written for BaseX 9.4. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery