Jus10
Jus10

Reputation: 15679

Firebase Hosting - Accessing API's?

If we're using Firebase hosting, how would we access someone's API without server-side scripts like php?

Upvotes: 2

Views: 509

Answers (2)

Gijo Varghese
Gijo Varghese

Reputation: 11780

Firebase hosting only hosts static files. So in order to call external api, you've to do it from JavaScript using fetch/axios or something like that. However, if the api endpoint hasn't enabled CORS for your domain, your browser doesn't allow to make that request for security.

Upvotes: 2

Jus10
Jus10

Reputation: 15679

I ended up figuring out how to do it using php.

Upvotes: 0

Related Questions