Create a gist now

Instantly share code, notes, and snippets.

// ----------------------------------------------------------------------------
// Copyright (c) 2015 Microsoft Corporation. All rights reserved.
// ----------------------------------------------------------------------------
// This is a base-level Azure Mobile App SDK.
var express = require('express'),
azureMobileApps = require('azure-mobile-apps');
var bodyParser = require('body-parser');
// Set up a standard Express app
var app = express();
// If you are producing a combined Web + Mobile app, then you should handle
// anything like logging, registering middleware, etc. here
// Configuration of the Azure Mobile Apps can be done via an object, the
// environment or an auxiliary file. For more information, see
var mobile = azureMobileApps({
// Explicitly enable the Azure Mobile Apps home page
homePage: true
// Import the files from the tables directory to configure the /tables endpoint
// Import the files from the api directory to configure the /api endpoint
// Initialize the database before listening for incoming requests
// The tables.initialize() method does the initialization asynchronously
// and returns a Promise.
.then(function () {
app.use(mobile); // Register the Azure Mobile Apps middleware
app.listen(process.env.PORT || 3000); // Listen for requests
var api = {
"post": function (req, res, next) {
var sqlstring = 'UPDATE Highscore SET score=@score,playername=@playername WHERE id=@id';
var query= {sql:sqlstring,
var sql2 = "SELECT * FROM Highscore WHERE id=@id";
var query2= {sql:sql2,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment