Skip to content

Commit

Permalink
makes utils funcs used
Browse files Browse the repository at this point in the history
  • Loading branch information
afzal442 committed Oct 27, 2023
1 parent 8e8b535 commit b612d9d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ruby/sync_with_meilisearch/lib/main.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
require 'appwrite'
require 'meilisearch'
require_relative 'utils'

def main(context)
required_env_variables = [
'APPWRITE_API_KEY',
'APPWRITE_DATABASE_ID',
'APPWRITE_COLLECTION_ID',
'MEILISEARCH_ENDPOINT',
'MEILISEARCH_INDEX_NAME',
'MEILISEARCH_ADMIN_API_KEY',
'MEILISEARCH_SEARCH_API_KEY',
]

throw_if_missing(ENV, required_env_variables)

client = Appwrite::Client.new
client
Expand Down Expand Up @@ -52,6 +64,7 @@ def main(context)
}

context.response.set_body(response.to_json)
context.response.set_status(200)

return context.response
end

0 comments on commit b612d9d

Please sign in to comment.