Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cloudflare Worker TMDB Proxy

Edge-cached proxy for The Movie Database (TMDB) API designed for media clients.

Features

  • Edge Caching: Caches TMDB responses across Cloudflare CDN network.
  • API Key Masking: Keeps TMDB API Key in environment secrets instead of client code.
  • CORS Enabled: Supports cross-origin requests.

Deployment

  1. Install Wrangler CLI:
npm install -g wrangler
  1. Login to Cloudflare:
npx wrangler login
  1. Set your TMDB API Key secret:
npx wrangler secret put TMDB_API_KEY
  1. Deploy the worker:
npx wrangler deploy

Integration

In NetworkModule.kt, update the TMDB base URL to point to your worker URL:

@Provides
@Singleton
@Named("tmdb")
fun provideTmdbRetrofit(okHttpClient: OkHttpClient, moshi: Moshi): Retrofit =
    Retrofit.Builder()
        .baseUrl("https://cf-worker.<your-subdomain>.workers.dev/3/")
        .client(okHttpClient)
        .addConverterFactory(MoshiConverterFactory.create(moshi))
        .build()

Local Development

npm run dev

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages