Giter VIP home page Giter VIP logo

s3-upload-files's Introduction

S3 Upload Files

S3 Upload files is a NodeJS application for uploading files to S3 with ease.

Prerequisite

  • S3 Upload files requires Node.js v10+ to run.

  • A configuration for s3 such as Secret Key, Key ID, Bucket name, etc
    Create a new file called .env and paste it. You may need to fill it with your own credentials

    PORT="3000"
    ACCESS_KEY_ID="ACCESS_KEY_ID"
    SECRET_ACCESS_KEY="SECRET_ACCESS_KEY"
    BUCKET_NAME="BUCKET_NAME"
    REGION="ap-southeast-1"

Installation

Local Development

Clone this repository

git clone https://github.com/aldycavalera/s3-upload-files.git

Then install all the dependencies

$cd s3-upload-files
$npm install

Create a new file inside of s3-upload-files/dist folder, name it to server.js or whatever you want. Then create your own development server by pasting this code:

const dotenv = require("dotenv");
dotenv.config();
const express = require("express");
const index = require("./index");

const upload = new index.Uploader();
const app = express();
const port = process.env.PORT;
const bodyPraser = require("body-parser");

app.use(
  bodyPraser.urlencoded({
    extended: false,
  })
);
app.listen(port);
console.log("\x1b[32m", `Server listening on port ${port}`);
upload.upload(app);

Start development server

$node ./dist/server.js

Deploy to Live Server

To deploy this package to your own hosting provider, please see DEPLOYMENT.md

License


MIT

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.