Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@orbiting/backend-modules-assets

Package Overview
Dependencies
Maintainers
6
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@orbiting/backend-modules-assets

server assets

  • 2.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-33.33%
Maintainers
6
Weekly downloads
 
Created
Source

@orbiting/backend-modules-assets

This module contains libs to un-/prefix relative asset urls, upload to S3 and most importantly express middlewares for asset proxying and image manipulation (resizing, greyscaling, webp format transformation). It streams assets from other urls, from s3 buckets, out of github repos and can render webpages to PNGs.

Check assets-backend for a deployable, standalone, express wrapper.

URLs

Endpoints

  • /github/:org/:repo/.../gitObjectId.suffix(.webp)

    gets the blob identified by it's :gitObjectId from github :org/:repo

    ENVs: GITHUB_LOGIN, GITHUB_APP_ID, GITHUB_APP_KEY, GITHUB_INSTALLATION_ID

  • /proxy(.webp)?originalURL=:url&mac=:mac

    proxies :originalURL

    ENVs: ASSETS_HMAC_KEY

  • /render?url=:url&width=:width&height=:height

    renders :url with a viewport of :width x :hight to a png. webp conversion not supported.

    ENVs: PHANTOMJSCLOUD_API_KEY, RENDER_URL_WHITELIST: comma separated, accept: :url.indexOf(whiteUrl) === 0

  • /s3/:bucket/:path*(.webp)

    fetches resources from a S3 bucket.

    ENVs: AWS_BUCKET_WHITELIST: comma separated, format: bucket:region,bucket:region

  • /frontend/:path*(.webp)

    fetches :path from FRONTEND_BASE_URL

    ENVs: FRONTEND_BASE_URL

Query params

If not specified otherwise all endpoints honour the following query params:

  • resize=:width[x:height] resizes an image to the specified dimensions. center-cropped if dimensions don't match

  • bw=true greyscale an image

FAQs

Package last updated on 26 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc