This package is still in development! This software is still likey to change dramatically and have minimal documentation prior to official release. Use caution before using this in a production application.
The Azure Mobile Apps Node.js SDK is an express middleware package which makes it easy to create a backend for your mobile application and get it running on Azure.
var app = require('express')(); // Create an instance of an Express app
var mobileApp = require('azure-mobile-apps')(); // Create an instance of a Mobile App with default settings
mobileApp.tables.add('TodoItem'); // Create a Table for 'TodoItem' with all default settings
app.use(mobileApp);
app.listen(process.env.PORT || 3000);
npm install --save azure/azure-mobile-apps-node
"dependencies": {
"azure-mobile-apps":"azure/azure-mobile-apps-node"
}
An official npm package will be published soon.
- API Documentation
- Tutorials & How-Tos
- StackOverflow #azure-mobile-services
- MSDN Forums
- Client & Server Quickstarts
- Create a new directory, initialize git, and initialize npm
mkdir quickstart
git init
npm init
- Install (with npm) the azure-mobile-apps and express packages
npm install express azure/azure-mobile-apps-node --save
- Create a server.js file and add the following code to the file:
var app = require('express')(); // Create an instance of an Express app
var mobileApp = require('azure-mobile-apps')(); // Create an instance of a Mobile App with default settings
mobileApp.tables.add('TodoItem'); // Create a Table for 'TodoItem' with all default settings
app.use(mobileApp);
app.listen(process.env.PORT || 3000);
-
Run your project locally with
node server.js
-
Publish your project to an existing Azure Mobile App by adding it as a remote and pushing your changes.
git remote add azure https://{user}@{sitename}.scm.azurewebsites.net:443/{sitename}.git
git add package.json server.js
git commit -m 'Quickstart created'
git push azure master
For steps 4-5, you can use any of the clients found in the Client & Server Quickstarts to test.
For information on how to contribute to this project, please see the contributor guide.