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.
- Clone the repository:
git clone https://github.com/DROSL/openpoll-api
- Install required modules:
npm install
-
Install the MongoDB server.
-
Create an upload folder for user files, like
uploads/
.
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.
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
}
}
}
Run the server with:
npm start
Import postman.json to Postman.
Please see the documentation.
Please see the license.
Before you commit, run:
npx prettier --write .