A Yeoman generator for DMN-flavored node apps.
$ npm install -g yo$ npm install -g gulp$ npm install -g nodemon$ npm install -g shelljs$ npm install -g generator-dmnapps
Also install ImageMagick for rendering images.
Create a clean directory for your app:
mkdir your-app-directorycd your-app-directory
Finally, initiate the generator in your app directory.
Important: Pay special attention when prompted to enter the sub- the project will live at on the server. It is not easily changed after being set.
The generator will set up your working directory, install dependencies, copy template files and scripts, start a
nodemon server and open your browser.
This generator use
gulp to watch your directories for changes, compile scss files and automatically reload your browser.
To start your server:
The behavior of the app is similar for static files, except files are rendered directly into the
public folder, rather than to a
HTML templates are not rendered into static pages, rather served via the app.
The generator will setup your app to serve from the sub-URI you specified. This is important to remember when navigating routes. For example, a route at
/employees will be served at
Deploying your app
There are several gulp tasks to help deploy, serve and take down your app from our servers using git and github.
First, get a developer to setup a directory on the test and production servers for your project. She will clone the project to
var/www/ and create an
.env file with database and other private credentials.
Available gulp tasks are separated into three categories:
deploypushes code to the server
serveregisters the app with the nginx web server, making your app public
pullde-registers the app with nginx, removing your app from any public URL
Each of these are combined with a suffix to be run on either the test or production server. For example:
gulp deploy-test will push code to the test server.
gulp serve-prod will make you app public on our
apps.dallasnews.com production server.
The available deploy tasks are:
Important: Before running any of these commands, make sure you've committed the latest changes to your app and pushed them to github.