1

I'm trying to build a client-side application with google-api-nodejs-client using browserify. Looks like inside it is trying to read some mime-type info using fs module and fails to do it in browser.

    // Load additional types from node.js community
    mime.load(path.join(__dirname, 'types/node.types'));

    // Default type
    mime.default_type = mime.lookup('bin');

Did anybody use this API for client side development?

4

1 回答 1

4

此问题已在 GitHub 上解决并关闭。

不幸的是,浏览器无法使用 fs。该库专为服务器端开发而设计和实现,不支持客户端开发。

查看专为 JavaScript 客户端应用程序开发人员设计的https://developers.google.com/api-client-library/javascript/ 。

于 2014-07-01T23:11:35.860 回答