Coder Social home page Coder Social logo

image-upload's Introduction

Image Uploader

Standalone service for uploading and automatically resizing images.

Configuration

Create a config JSON file e.g. by copying the config/config.sample.json file.

Property Default Valid values
logLevel warn silly, debug, verbose, info, warn, error
storage disk: uploads directory in project root See below
database in-memory See below
imageSizes Array of { name: string, width: number, height: number } where width and height are pixel values to resize the image to.

Storage

Disk: The images will be uploaded to a directory on the server. This directory must have write permissions for the server process.

Property Valid values
type disk
path Full absolute path to a writable directory on the server. If the directory does not exist it will be created.

AWS: The images will be uploaded to the given S3 bucket.

Property Valid values
type aws
bucketName Name of a bucket in the region configured in awsSettingsFile
awsSettingsFile Full path to an AWS credentials file.

Database

In-Memory: Items are stored in memory. Everything will be lost on shutdown.

Property Valid values
type memory

File: Data is stored in a file on the filesystem.

Property Valid values
type file
path Full path to a file. This will be overwritten.

MongoDB: Data is stored in a MongoDB instance.

Property Valid values
type mongodb
url MongoDB connection string including the database path

Image Sizes

Images uploaded to the server can be fetched in a variety of sizes, configured here. Names and sizes provided will allow downloading the image at /:imageId/:size in the given size.

Images will be resized at the first time they are requested in a given size.

image-upload's People

Contributors

paullessing avatar

Watchers

David Stefan avatar James Cloos avatar

image-upload's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.