You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

avoscloud-code-mock-sdk

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

avoscloud-code-mock-sdk

AVOSCloud Cloud Code Mock SDK.!


Version published
Weekly downloads
4
increased by300%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

说明

为了方便本地运行和调试云代码,请遵照下列步骤进行:

  • 要在本地调试云代码,你需要安装node.js最新版本。
  • 运行命令: sudo npm install -g avoscloud-code-mock-sdk 安装调试SDK。
  • 在项目根目录运行avoscloud,将启动本地调试服务器。
  • 访问http://localhost:3000/即可访问到你的云主机代码,子路径按照你在app.js里配置的即可访问。
  • 测试函数:
curl -X POST -H 'Content-Type:application/json' \
    -d '{ "name": "dennis"}' \
    http://localhost:3000/avos/hello

其中hello是你通过AV.Cloud.define定义的函数名称。

  • 测试beforeSave,afterSave,afterUpdate,beforeDelete/afterDelete等:
curl -X POST -H 'Content-Type:application/json' \
     -d '{ "name": "dennis"}' \
	 http://localhost:3000/avos/MyUser/beforeSave

其中MyUser是className,beforeSave指定调用MyUser定义的beforeSave函数,其他函数类似。

更新日志

  • 2013-10-17 更新0.2.0版本,添加定时器API

FAQs

Package last updated on 18 Oct 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc