I just download newest packeage for server and try to run it. After I type npm run I get:
[root@servx parse]# npm start
> parse-server-example@2.0.0 start
> node index.js
file:///home/parse/index.js:43
const parse = new ParseServer(api);
^
TypeError: ParseServer is not a constructor
at file:///home/parse/index.js:43:15
at ModuleJob.run (node:internal/modules/esm/module_job:262:25)
at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:482:26)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5)
Node.js v22.8.0
my modified code of index.js is:
import http from 'http';
import express from 'express';
import ParseServer from 'parse-server';
import ParseDashboard from 'parse-dashboard';
import path from 'path';
const __dirname = path.resolve();
export const api = {
//config
};
var dashboard = new ParseDashboard({
//config
});
export const app = express();
app.set('trust proxy', true);
const parse = new ParseServer(api);
await parse.start();
app.use('/gildia', parse.app);
app.use('/', dashboard);
const httpServer = http.createServer(app);
httpServer.listen(1337, function() {
console.log('Parse running on port 1337.');
});
I just download newest packeage for server and try to run it. After I type npm run I get:
my modified code of index.js is:
any tips what I am doing wrong?