How to use the parse-server.TestUtils function in parse-server

To help you get started, we’ve selected a few parse-server examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github andrewimm / parse-lite / integration / server.js View on Github external
var app = express();

// Specify the connection string for your mongodb database
// and the location to your Parse cloud code
var api = new ParseServer({
  databaseURI: 'mongodb://localhost:27017/integration',
  appId: 'integration',
  masterKey: 'notsosecret',
  serverURL: 'http://localhost:1337/parse', // Don't forget to change to https if needed
  cloud: __dirname + '/cloud/main.js',
});

// Serve the Parse API on the /parse URL prefix
app.use('/parse', api);

const TestUtils = require('parse-server').TestUtils;

app.get('/clear', (req, res) => {
  TestUtils.destroyAllDataPermanently().then(() => {
    res.send('{}');
  });
});

app.listen(1337, () => {
  console.log('parse-server running on port 1337.');
});
github parse-community / Parse-SDK-JS / integration / server.js View on Github external
},
    facebook: {
      appIds: "test"
    },
    twitter: {
      consumer_key: "5QiVwxr8FQHbo5CMw46Z0jquF",
      consumer_secret: "p05FDlIRAnOtqJtjIt0xcw390jCcjj56QMdE9B52iVgOEb7LuK",
    },
  },
  verbose: false,
  silent: true,
});

app.use('/parse', api);

const TestUtils = require('parse-server').TestUtils;

app.get('/clear', (req, res) => {
  TestUtils.destroyAllDataPermanently().then(() => {
    res.send('{}');
  });
});

module.exports = {
  app
};