@@ -87,6 +87,10 @@ NpgsqlRest is the superior alternative to existing automatic PostgreSQL REST API
8787
8888And more!
8989
90+
91+
92+ ----------
93+
9094## Get Started in Seconds
9195
9296Starting is easy:
163167comment on function hello_world() is '
164168HTTP GET /hello
165169Content-Type: text/plain
166- authorize admin' ||
170+ authorize admin
167171' ;
168172```
169173
@@ -176,34 +180,48 @@ Depending on distribution used, run the executable, NPX command or Docker comman
176180#### 3) Auto-Generated HTTP File
177181
178182``` console
179- @host=http://localhost:8080
183+ @host=http://localhost:8080
180184
181185// function public.hello_world()
182186// returns text
187+ //
188+ // comment on function public.hello_world is 'HTTP GET /hello
189+ // Content-Type: text/plain
190+ // authorize admin';
183191GET {{host}}/hello
192+
193+ ###
184194```
185195
186196#### 4) Auto-Generated Typescript Client Module
187197
188198``` ts
189- const _baseUrl = "http://localhost:8080";
199+ // autogenerated at 2025-08-17T11:06:58.6605710+02:00
200+ const baseUrl = " http://localhost:8080" ;
190201
202+ export const publicHelloWorldUrl = () => baseUrl + " /hello" ;
191203
192204/**
193- * function public.hello_world()
194- * returns text
195- *
196- * @remarks
197- * GET /hello
198- *
199- * @see FUNCTION public.hello_world
200- */
201- export async function getHelloWorld() : Promise<string> {
202- const response = await fetch(_baseUrl + "/hello", {
205+ * function public.hello_world()
206+ * returns text
207+ *
208+ * @remarks
209+ * comment on function public.hello_world is 'HTTP GET /hello
210+ * Content-Type: text/plain
211+ * authorize admin';
212+ *
213+ * @returns {{status: number, response: string}}
214+ *
215+ * @see FUNCTION public.hello_world
216+ */
217+ export async function publicHelloWorld() : Promise <{status: number , response: string }> {
218+ const response = await fetch (publicHelloWorldUrl (), {
203219 method: " GET" ,
204- headers: { "Content-Type": "application/json" },
205220 });
206- return await response.text() as string;
221+ return {
222+ status: response .status ,
223+ response: await response .text ()
224+ };
207225}
208226```
209227
0 commit comments