1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- const express = require('express');
- const path = require('path');
- const ParseServer = require('parse-server').ParseServer;
- const cors = require('cors');
- const app = express();
- app.use(cors());
- const api = new ParseServer({
- databaseURI: 'postgresql://dev:666@dev.fmode.cn:5432/dev',
- appId: 'dev',
- masterKey: 'devmk',
- masterKeyIps: ['0.0.0.0/0','::/0'] ,
- allowClientClassCreation:true,
- allowHeaders:["*"],
- allowOrigin:"*",
-
-
-
-
- }
- );
- async function main(){
- await api.start();
- app.use(express.json());
-
- app.use('/parse', api.app);
-
- const pdfRouter = require('./api/agent/loader/routes');
- app.use('/api/agent', pdfRouter);
- const retriveRouter = require('./api/agent/retrive/routes');
- app.use('/api/agent', retriveRouter);
- const ncloudFunc = require('./api/ncloud/func/routes');
- app.use('/api/ncloud', ncloudFunc);
- const psqlRouter = require('./api/psql/routes');
- app.use('/api/psql', psqlRouter);
- const port = 1337;
- app.listen(port, function() {
- console.log('parse-server-example running on port ' + port + '.');
- });
- }
- main();
|