tree: b964f5bbfa6235f25e71d7648131bbd2b4cd8966 [path history] [tgz]
  1. README.md
  2. serve.json
http/get_range/js/server/README.md

HTTP GET Arrow Data: Range Request Node.js Server Example

The example in this directory shows how to use the Node.js package serve (which supports range requests) to serve a static Arrow IPC stream file over HTTP.

To run this example, copy the file random.arrows from the directory data/rand-many-types/ into the current directory:

cp ../../../../data/rand-many-types/random.arrows .

Then start the HTTP server to serve this file:

npx serve -l 8008

[!NOTE]
The npm package serve should automatically set the Content-Type header to application/vnd.apache.arrow.stream when serving a file with extension .arrows, because the Arrow IPC stream format is officially registered with IANA and most web servers including serve use registration data from IANA to determine the media type of a file based on its file extension and set the Content-Type header to that media type when serving a file with that extension. However, this is not working with .arrows files in the serve package, seemingly because of a problem with the npm package mimedb which serve depends on. So the file serve.json is used to set the Content-Type header correctly when serving .arrows files.