@augmt/file-metadata-microservice

File Metadata Microservice

Usage no npm install needed!

<script type="module">
  import augmtFileMetadataMicroservice from 'https://cdn.skypack.dev/@augmt/file-metadata-microservice';
</script>

README

File Metadata Microservice

Get the size of a file in bytes.

How it Works

This microservice uses koa-body to parse binary data and Koa and koa-router to serve requests.

How to Use

app.js exports a Koa app. Koa apps have an app.listen() method that is identical to Node's http.Server.listen().

Import app.js and call app.listen() to start up the microservice.

API Resources

POST /

Returns an object containing the data's size in bytes.

REQUEST

Sample: https://file-metadata-microservice.example.com/

Content-Type: multipart/form-data

Request:

------WebKitFormBoundary7fkjhx85BAWpokZH
Content-Disposition: form-data; name="file"; filename="blob"
Content-Type: text/plain


------WebKitFormBoundary7fkjhx85BAWpokZH--

RESPONSE

Status: 200 - application/json

Response:

{
  "filesize": 1149
}