a first attempt at a database wrapper app over postgres
Change the values in appInfo.json. host
should reflect the host where the app will be served and name
should reflect the display name of the application. Also add a line sparkPostApiKey=thisIsYourKey
, substituting your SparkPost API key, to the file .env, creating such a file if it doesn't exist.
I recommend that you manage Node/NPM versions using NVM. Install it like so:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash
After you've installed NVM, you'll need to start a new shell in order to use it. you can either close and reopen your shell or start a new one, like so:
bash
Next, use NVM to install the version of Node and NPM specified for the project.
nvm install
Use NVM to load Node and NPM into your PATH so that you can run Node and NPM commands. You'll need to do this in each new shell.
nvm use
npm install
The app needs a local Postgres database named sandbox with user sandboxUser. To run the script that sets this up (including installing Postgres on Ubuntu):
npm run dbSetup
npm run cert
npm test
npm run lint
This will run the application synchronously.
sudo $(which node) index.js
Alternatively, this will run the application and free the current shell.
npm start