class

Cloudinary::Connect

Inherits Reference < Object

Adding module for upload image to cloudinary Has been add:

  • 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

Constructors

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

Source

Instance methods

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
Source