Sample NodeJS backend for SurveyJS: Survey library and Survey Creator
This demo illustrates how to integrate SurveyJS libraries with NodeJS backend. This demo doesn't cover all of real survey service application aspects, such as authentication, authorization, user management, access levels and different security issues. These aspects are covered by backend-specific articles, forums and documentation. This demo is just a sample of intergration and can't be used as a real service.
- Install NodeJS.
- Clone this repository into the
surveyjs-nodejsfolder (and make it the current directory via
- Install npm packages via the
- Run the server via the
At this point, the surveyjs-nodejs demo service will be available at
If everything is ok, you should see the project home page with a list of available surveys and links to
Survey Creator pages.
- You can continue with a survey via the
Runpage, go through the survey and post results to the custom service.
- You can continue with Survey Creator via the
Editpage, change the survey and store survey JSON to the custom service.
- Saved survey results are available via the
Adding Postgresql database to the backend
- Install docker on your computer.
- Build a postgresql-db docker container via the
docker build -t postgresql-db .command in the
- Start the docker container via the
docker run --name dbsrv -p 5432:5432 -d postgresql-dbcommand.
Note: if you are familliar with docker and docker-compose, just run
docker-compose up from the
docker folder instead of above commands.
- Change db adapter from InMemoryDBAdapter to Postgresql one.