Skip to content

Latest commit

 

History

History
87 lines (58 loc) · 2.21 KB

README.md

File metadata and controls

87 lines (58 loc) · 2.21 KB

OSOP API

Our Simple Open Poll (OSOP) is an open source web application for conducting polls and surveys with a special focus on data minimization and user privacy. It does not collect personal data, does not set tracking cookies, and does not outsource the service to third-party solutions, but runs entirely on your own server.

Install

  1. Clone the repository:
git clone https://github.com/DROSL/openpoll-api
  1. Install required modules:
npm install
  1. Install the MongoDB server.

  2. Create an upload folder for user files, like uploads/.

Configuration

Environment variables

Set the following environment variables:

Name Type Description
NODE_ENV string Indicates whether the server is running in development or production mode.
PORT or API_PORT number The port on which the server listens.
MONGODB_URI string The URI of the MongoDB instance to connect to. (Read more)
SESSION_SECRET string The secret used to sign the session ID cookie. Sould be a random set of characters. (Read more)

Note: You can use a .env file to set the environment variables. See .env.sample as example.

Config files

The config files are located in the config/ directory and are loaded depending on the NODE_ENV environment variable. default.json is always used as fallback. The following parameters can be configured:

{
	"path": "/",
	"cookie": {
		"secure": true,
		"httpOnly": true
	},
	"upload": {
		"dest": "uploads/",
		"limits": {
			"fileSize": 104857600
		}
	}
}

Usage

Run the server with:

npm start

Testing

Import postman.json to Postman.

Documentation

Please see the documentation.

License

Please see the license.

Contributing

Before you commit, run:

npx prettier --write .