parse-community / parse-server

Parse Server for Node.js / Express
https://parseplatform.org
Apache License 2.0
20.95k stars 4.78k forks source link

Define which `ParseServerOptions` apply to startup methods #8300

Open dblythy opened 2 years ago

dblythy commented 2 years ago

New Feature / Enhancement Checklist

Current Limitation

There are two different types of startup methods (considering const { Parse Server } = require('parse-server')):

  1. new ParseServer() This returns an express middleware to be passed to an express app, designed to be compatible with existing web servers
  2. ParseServer.start This creates a Parse Server instance with it's own new express app.

As such, certain Parse Server options (cluster, startLiveQueryServer) are only compatible with the 2nd startup method, as if a developer is looking to mount to an existing express app, they will have to configure the clustering of the process themselves.

Feature / Enhancement Description

This can create some confusion as it can be assumed all Parse Server options are relevant to new ParseServer()

Example Use Case

Alternatives / Workarounds

Leave as is

3rd Party References

Sidenote

new ParseServer() returns differently depending on whether it's imported from:

const ParseServer = require('ParseServer') // creates Parse Server instance

or

const { ParseServer } = require('ParseServer') // creates express middleware (used in example project)

Discussed here https://github.com/parse-community/parse-server/pull/8232#issuecomment-1306718881

parse-github-assistant[bot] commented 2 years ago

Thanks for opening this issue!

mtrezza commented 2 years ago

Is this purely a docs issue?

dblythy commented 2 years ago

Yes, the ParseServerOptions specifically