Git Product home page Git Product logo

kitten-cloud's Introduction

Kitten Cloud (Cloudinary Image Upload Demo)

This project demonstrates how to upload images to Cloudinary using Next.js API routes.

Data Flow

pages/index.js

pages/index.js contains a form that allows you to upload an image to the api/upload route using fetch. It then displays all uploaded images from a state persisted in local storage.

pages/api/upload.js

pages/api/upload.js contains the route that handles the image upload.

  • It uses the formidable package to parse the incoming request.
  • It uses the cloudinary package to upload the image to Cloudinary.

Cloudinary

You need to set up cloudinary account and create a cloudinary project to use this demo.

Set these environment variables in your .env.local file or in your deployment environment:

CLOUDINARY_CLOUD_NAME=
CLOUDINARY_API_KEY=
CLOUDINARY_API_SECRET=

Template

This project was created from the neue fische next template.

You can ๐Ÿ”— use this template on CodeSandbox or locally by running this command in your Terminal:

npx -y ghcd@latest neuefische/web-exercises/tree/main/templates/next my-app -i

Development

Local Development

To work locally, please install the dependencies using npm i first.

Run npm run dev to start a development server and open the displayed URL in a browser.

Use npm run test to run the tests.

CodeSandbox Cloud

Select the "Preview: 3000" tab to view this project.

Select the "Tests: logs" tab to view the tests.

The npm run dev and npm run test scripts run automatically.

Scripts

You can use the following commands:

  • npm run dev to start a development server
  • npm run build to build the project
  • npm run start to start a production server
  • npm run test to run the tests
  • npm run lint to run the linter

kitten-cloud's People

Contributors

djfarly avatar

Stargazers

 avatar

Watchers

 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.