【发布时间】:2014-12-22 08:28:38
【问题描述】:
我是 strongloop 的新手,我会查看文档和示例,但从来没有看到我想要的问题。 我有两个模型,sentence.js 和 log.js,并让 post 请求从移动应用程序到 rest-api 的句子,例如
Model sentence.js (dont want save to db this model, only for parsing and creating log model)
{
name: 'sentence',
type: 'string'
}
Model log.js
{ name: 'lat', type: 'string' },
{ name: 'lng', type: 'string' }
[HTTP POST] myserver/api/sentence?d=$GPRMC,123519,A,4807.038,N,01131.000,E,022.4,084.4,230394,003.1,W*6A
模型具有触发方法,例如 afterInitialize、beforeValidate、beforeSave。现在,哪个触发方法或任何其他范围正确且最适合解析句子模型和创建日志模型?
谢谢!
【问题讨论】:
标签: node.js rest loopbackjs strongloop