javascript - 从 Parse 将媒体上传到 AWS

标签 javascript node.js amazon-web-services parse-platform amazon-elastic-transcoder

我使用 Node 构建了一个 API,允许用户上传数据和媒体(照片或视频)。 我已经使用 AWS 设置了所有内容来存储媒体并将其从 mp4 转换为可流式传输的内容。

在构建了很多 API 后,我决定最好只使用解析。

由于我显然不想通过解析来存储媒体文件,有没有办法在 Parse 中存储来自正常 POST 请求的媒体数据(位置、描述、标签、user_id、created_date...),但让 Parse 将媒体文件发送到 AWS,然后还告诉 AWS 启动 Elastic Transcoder 作业?

最佳答案

您可以使用Parse Cloud Code Webhooks为了达成这个。下面是一些相关的高级描述文章和与 Heroku 连接的可用演示,但它应该类似于与 AWS 连接——毕竟​​ Heroku 托管在 AWS 上:)

Introducing Cloud Code Webhooks

With this, you can now specify any URL to receive a POST in response to triggers like beforeSave and afterSave on objects, as well as when a Cloud Function is called. You now have the freedom to write code in whatever language you want. As long as you have a server running it, your Cloud Code can integrate with it.

Parse with Heroku

One powerful feature of Parse is Webhooks, which lets you connect your Parse app to any server on the web to use a custom server environment rather than Parse’s hosted Cloud Code. We’re always looking for ways to make Parse easier to use, and recently, we released Node.js middleware to make it easier to connect your Parse app to a Node.js server.

Today we’re excited to announce that we’re partnering with Heroku to make it even easier to connect your Parse app to Node.js code. If you like Parse’s Cloud Code but wish you had a full Node.js environment, this is a great solution. We’ve created a smooth experience for you to run code on either Heroku or the Parse Cloud and we’re very excited about the opportunities this combination has to offer.

关于javascript - 从 Parse 将媒体上传到 AWS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34662981/

相关文章:

javascript - 如果 highcharts.js 没有数据,图表容器的最小高度

node.js - 如何使用node.js正确地将新元素推送到mongodb数组

angularjs - Mongoose 从两个相关集合中获取记录并填充

amazon-web-services - 写入 S3Object : The file indicated by the FilePath property does not exist

javascript - 从另一个外部函数调用 mootools 类方法

javascript - 如何检测 Canvas 中的图像何时被单击或至少获取其位置?

javascript - 如何在 javascript 中捕获浏览器的后退/前进按钮单击事件或哈希更改事件?

linux - 使用 libusb 而不是 hidraw 编译 hidapi

amazon-web-services - 如何在我的亚马逊 ec2 服务器上打开端口 2195 和 443?

java - Amazon 是否提供低成本云存储后门,用于通过 Google App Engine 等 Servlet 提供文件?