server.js 645 B

1234567891011121314151617181920212223242526
  1. const express = require('express');
  2. const ParseServer = require('parse-server').ParseServer;
  3. const app = express();
  4. const api = new ParseServer({
  5. databaseURI: 'postgresql://fearless:1004@dev.fmode.cn:5432/fearless',
  6. appId: 'fearless',
  7. masterKey: 'fearless',
  8. masterKeyIps: ['0.0.0.0/0','::/0'] ,
  9. allowClientClassCreation:true,
  10. allowHeaders:["*"],
  11. allowOrigin:"*",
  12. });
  13. async function main(){
  14. await api.start();
  15. // Serve the Parse API at /parse URL prefix
  16. app.use('/parse', api.app);
  17. const port = 1337;
  18. app.listen(port, function() {
  19. console.log('parse-server-example running on port ' + port + '.');
  20. });
  21. }
  22. main();