Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #38986

Re: Npm module to build web API

Message-ID <YRs_BUHvaPR_0phwjuNJiqo8Yuc@jntp> (permalink)
Subject Re: Npm module to build web API
References <7njX6frWR21gXAJ3wXYyMRfKDvQ@jntp> <6e6445e1-8cfd-4390-baaf-a7ed7015659cn@googlegroups.com> <WqNKULZwFhKLthS_Z9iFNOkpPqQ@jntp> <CGt0dtM8SYa66zxPYx7JLpibuoA@jntp> <08df519a-fba2-47c4-9e75-24756ed07b45n@googlegroups.com>
Newsgroups comp.lang.javascript
Date 2020-10-18 11:15 +0000
Organization Nemoweb
From Julien Arlandis <julien.arlandis@gmail.com>

Show all headers | View raw


Le 18/10/2020 à 03:28, "Michael Haufe (TNO)" a écrit :
> On Saturday, October 17, 2020 at 4:50:23 PM UTC-5, Julien Arlandis wrote:
> 
>> For example, you can use bebel to compute : 
>> ["sum", [a, b, c, ...]] => a + b + c... 
>> ["square", a] => a^2 
>> So you can combine the two expressions : 
>> ["square", ["sum", [3, 5, 2]]] => ["square", 10] => 100
> 
> 
> Still feels limiting for a client. If I want an image or XML returned for 
> example, 
> what would that look like? For the image would I be forced
> to encode it in base64?
> 
> Is this always an http POST/Response transaction?

Yes you can map queries and responses.
This picture upload with a bebel query : 
<http://news2.nemoweb.net/jntp?YRs_BUHvaPR_0phwjuNJiqo8Yuc@jntp/Data.Media:1.>
This image can also be downloaded via the get method :
http://news2.nemoweb.net/jntp/?YRs_BUHvaPR_0phwjuNJiqo8Yuc@jntp/Data.Media:1
So, you can choose mime-type.
If you are interested, I can add an example in the module or in the doc.

> Can I use a url equivalent?
> 
> http://localhost/sum?p=3,5,2

Yes you can add a route if necessary.

Back to comp.lang.javascript | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Npm module to build web API Julien Arlandis <julien.arlandis@gmail.com> - 2020-10-17 17:44 +0000
  Re: Npm module to build web API "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-10-17 11:44 -0700
    Re: Npm module to build web API Julien Arlandis <julien.arlandis@gmail.com> - 2020-10-17 21:13 +0000
      Re: Npm module to build web API Julien Arlandis <julien.arlandis@gmail.com> - 2020-10-17 21:50 +0000
        Re: Npm module to build web API "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-10-17 18:28 -0700
          Re: Npm module to build web API Julien Arlandis <julien.arlandis@gmail.com> - 2020-10-18 11:15 +0000
          Re: Npm module to build web API "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-10-18 10:23 -0700
            Re: Npm module to build web API Julien Arlandis <julien.arlandis@gmail.com> - 2020-10-18 18:31 +0000

csiph-web