diff --git a/README.md b/README.md index 030e048..795a1a1 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ + # kno-logic-api

@@ -5,10 +6,10 @@ Kno-logic is a mobile learning platform with a short number of curated articles added daily for lifelong learners. This API was built with NodeJS and Express, and uses MongoDB as a database. -## Developing locally +## Running Application If you would like to run the application you will need: - NodeJS 14 - - MongoDB Community + - MongoDB Community Server Install the latest version of [`Node.js`](https://nodejs.org/en/). @@ -28,3 +29,29 @@ nodemon # running the server node . ``` +## Email Templates +Emails are stored in the [`templates`](https://github.com/jslightham/kno-logic-api/tree/main/templates) directory. Any text files in the [`templates`](https://github.com/jslightham/kno-logic-api/tree/main/templates) directory will be added to the MongoDB message collection. + +Any portion of the message can be replaced when sending the email. The convention used in all default email templates is `%replace_string%`. The replace string does not matter since when calling the sendMail function, replacements is an array of data with the form `{from: "%replace_string%", to: "Username"}`. + +## Configuration +Configuration for the application is done in the [`config.js`](https://github.com/jslightham/kno-logic-api/blob/main/config.js) file. + +Example configuration: +``` +var config = {}; + +// Mailer settings +config.mail = {}; +config.mail.host = "localhost"; +config.mail.port = "465"; +config.mail.secure = false; +config.mail.user = "username"; +config.mail.pass = "pass"; +config.mail.from = "" + +// Session purge settings +config.maxSessionLength = 30; + +module.exports = config; +```