Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
141 lines (92 sloc) 2.56 KB

Haventec Authenticate sample server

This is a sample server to demonstrate how to communicate with the Haventec Authenticate server. This server is NOT intended to be used in a Production environment.

Getting Started

Download the sample server from GitHub Haventec


Install NodeJS

Install NPM


Install the dependencies within the root folder

npm install

Configure the server

Create a config file (rename the template file)

Linux / Mac:

mv config.js.template config.js


rem config.js.template config.js

Edit the config.js file

Linux / Mac:

vi config.js



Add your API key

Your API key is available in Cloud Portal account under Applications

config.application.apiKey = 'xxxx-xxxx-xxxx-xxxx-xxxx';

Configure the mail server (Optional)

This is optional, if you do not configure your mail server the activation and reset codes will also be outputted to the server console (not recommended for Production)

This Sample server includes a mail module to send activation and reset codes to your users

You can run this sample server without the mail module

Leave the mail configurations blank if you do not want to send emails = ''

If you wish to use the mail functionality and do not have an existing mail server, you can create one for free:

Testing your mail server

Call the test email endpoint



Start the server

npm start 

Testing your server

Go to


Running on AWS Lambda

In the config file set: = true;

Zip up the following files

zip -r node_modules index.js config.js

Upload the to your AWS Lambda function

Testing on AWS Lambda

Set the Lambda test event to

  "path": "/"

You should see a 200 response and no errors

To test your email set the Lambda test event to

  "path": "/test-email?"

Built With



This project is licensed under the MIT License - see the file for details