Azure Mobile Apps - An item to insert was not provided

为君一笑 提交于 2019-12-12 03:21:17

问题


I am trying to create a new table on my nodeJS custom Azure Mobile App backend. The table is called readings.js:

var azureMobileApps = require("azure-mobile-apps");
var table = azureMobileApps.table();
table.columns = {
    "text": "string",
    "complete": "boolean"
};
module.exports = table;

app.js:

var express = require("express");
var azureMobileApps = require("azure-mobile-apps");
var app = express();

var mobileApp = azureMobileApps({
    homePage: true,
    swagger: true
});

mobileApp.tables.import("./tables");

mobileApp.tables.initialize()
    .then(function () {
    app.use(mobileApp); // Register the Azure Mobile Apps middleware
    app.listen(process.env.PORT || 3000); // Listen for requests
});

and yet, this is the reposnse I get when POST'ing to the API:

Why is this error occurring?


回答1:


It seems you are developing Azure Mobile Apps on local environment. Here is a post in the same scenario guiding you how to do. You can refer to detailed info.

Regarding your issue, post data via POSTMAN, please try to select the raw radio button in body tab, and select the JSON content type, then directly write the json object in the textare.

Any further concern, please feel free to let me know.



来源:https://stackoverflow.com/questions/38426765/azure-mobile-apps-an-item-to-insert-was-not-provided

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!