GithubHelp home page GithubHelp logo

onchain-archive / cos-web-gallery Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ibm/cos-web-gallery

0.0 1.0 0.0 282 KB

This application demonstrates a simple Node.js Express web app that stores images in IBM Cloud Object storage, and retrieves their object URL to display them in a web gallery view.

Home Page: https://developer.ibm.com/patterns/build-a-web-gallery-app-in-the-cloud/

License: Apache License 2.0

JavaScript 60.89% CSS 11.41% HTML 27.70%

cos-web-gallery's Introduction

IBM Cloud Object Storage Web Gallery

In this Code Pattern, we will create a Web Gallery using a Node.js Express web app that stores images to IBM Cloud Object storage, and retrieves their object URL to display them. At the heart of the server side app is the JavaScript IBM COS SDK package which handles the authentication and connectivity to IBM COS. Express handles the routing allowing the business logic to be handled by the controller. The upload form uploads an image to an express route which calls functions from the IBM COS SDK, multer, and multer-s3 functions to upload it to the designated IBM COS bucket. A request for the image gallery view invokes IBM COS SDK functions to get the URL for each image in the bucket. The URL data is sent back in the response and merged with the EJS view template and during the view rendering.

When the reader has completed this Code Pattern, they will understand how to:

  • Deploy a Node.js app (optionally using Cloud Foundry)
  • Provision a service instance of Cloud Object Storage
  • Use the Node.js IBM COS SDK to interact with Cloud Object Storage

Flow

  1. From the Image Upload form the user selects an image by using the photo gallery upload form and clicks Upload.
  2. The form performs a POST to the app, and the app uses the S3 SDK to generate a PUT to the IBM COS server.
  3. The user clicks the Gallery tab, which makes a GET request to the app for the gallery view.
  4. The app performs a GET request through the S3 SDK to retrieve the image URLs of the images that are stored in the IBM COS bucket. The image URLs passed back in the response are merged with the view template which is rendered for the user and the images are displayed.

Included components

  • Cloud Foundry: Build, deploy, and run applications on an open source cloud platform.
  • Cloud Object Storage: Build and deliver cost effective apps and services with high reliability and fast speed to market in an unstructured cloud data store.

Featured technologies

  • Cloud: Accessing computer and information technology resources through the Internet.
  • Node.js: An open-source JavaScript run-time environment for executing server-side JavaScript code.

Deployment options

Click on one of the options below for instructions on deploying the app.

public local

Sample output

Once run either locally or on IBM Cloud, you should see the following page when you hit the URL for your application:

License

This code pattern is licensed under the Apache Software License, Version 2. Separate third party code objects invoked within this code pattern are licensed by their respective providers pursuant to their own separate licenses. Contributions are subject to the Developer Certificate of Origin, Version 1.1 and the Apache License, Version 2.

Apache License FAQ

cos-web-gallery's People

Contributors

loafyloaf avatar sbollers avatar stevemart avatar imgbotapp avatar kant avatar dolph avatar ljbennett62 avatar stevemar avatar ykoyfman avatar

Watchers

James Cloos avatar

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.