class Cloudinary::Connect

Overview

Adding module for upload image to cloudinary Has been add:

Defined in:

cloudinary.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(api_key : String = "", cloud_name : String = "", preset : String = "") #

Create a instace

api_key => of acount on cloudinary

cloud_name => of cloud in the acount

preset => of preset that gives permission, read documentation of module or cloudinary


[View source]

Instance Method Detail

def upload(env, folder : String) #

Upload image to server

env refers to context of server when make a request to endpoint

folder where the image is saved in the cloudinary

Example:

server = HTTP::Server.new do |context|
  response = CLOUDINARY.upload(
    context,
    "test"
  )

  context.response << response
end

server.bind_tcp 8085
server.listen

[View source]