Want to feel like a full-stack Angular developer but know only Express?
This is an express seed project for Angular apps based on Minko Gechev's angular-seed. Include:
- Full include from Minko Gechev's angular-seed.
- Express Express Node.js server for production/development build API.
- PM2 daemon for a server running.
- Nginx configuration file for your server.
For Angular development information and wiki, look here:
- Angular-Seed
- Angular-Seed-WIKI Wiki Information about Seed!
- Angular-Seed-Advanced It's a Nathan's Walker child seed for multi-platform Angular apps.
git clone --depth 1 https://github.com/vyakymenko/angular-seed-express.git cd angular-seed-express # install the project dependencies $ npm install # watches your files and uses livereload by default $ npm start # api document for the app # $ npm run compodoc # dev build $ npm run build.dev # prod build $ npm run build.prod # run Redis $ src/redis-server # stop Redis $ src/redis-cli $ shutdown SAVE # run Express server (keep in touch, only after `npm run build.prod` ) $ node app.server.prod.js # run server in daemon mode $ pm2 start app.server.prod.jsExpress server run for prod build.
# run Express server (keep in touch, only after `npm run build.prod` ) # keep in mind that prod build will be builded with prod env flag $ node app.server.prod.jsFor daemonize your server I propose to uze PM2.
# before daemonize production server `npm run build.prod` $ pm2 start app.server.prod.js # restart only your project $ pm restart <id> # restart all project on daemon $ pm2 restart all # in cluster mode ( example 4 workers ) $ pm2 start app.server.prod.js -i 4More details about PM2
## # Your Angular.io NginX .conf ## http { log_format gzip '[$time_local] ' '"$request" $status $bytes_sent'; access_log /dev/stdout; charset utf-8; default_type application/octet-stream; types { text/html html; text/javascript js; text/css css; image/png png; image/jpg jpg; image/svg+xml svg svgz; application/octet-steam eot; application/octet-steam ttf; application/octet-steam woff; } server { listen 3353; server_name local.example.com; root app/; add_header "X-UA-Compatible" "IE=Edge,chrome=1"; location ~ ^/(scripts|styles)/(.*)$ { root .tmp/; error_page 404 =200 @asset_pass; try_files $uri =404; break; } location @asset_pass { root app/; try_files $uri =404; } location / { expires -1; add_header Pragma "no-cache"; add_header Cache-Control "no-store, no-cache, must-revalicate, post-check=0 pre-check=0"; root app/; try_files $uri $uri/ /index.html =404; break; } } server { listen 3354; sendfile on; ## # Gzip Settings ## gzip on; gzip_http_version 1.1; gzip_disable "MSIE [1-6]\."; gzip_min_length 1100; gzip_vary on; gzip_proxied expired no-cache no-store private auth; gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript; gzip_comp_level 9; root dist/; location ~ ^/(assets|bower_components|scripts|styles|views) { expires 31d; add_header Cache-Control public; } ## # Main file index.html ## location / { try_files $uri $uri/ /index.html =404; } } } You can look in source file here.
app.server.dev.js
// Configure server Port ( keep in mind that this important if you will use reverse-proxy) // Dev mode will give you only middleware. // WARNING! DEPEND ON YOUR Angular SEED PROJECT API CONFIG! /** * @ng2 Server Runner `Development`. */ require('./server')(9001, 'dev');app.server.prod.js
// Configure server Port ( keep in mind that this important if you will use reverse-proxy) // Prod mode give you middleware + static. // WARNING! DEPEND ON YOUR Angular SEED PROJECT API CONFIG! /** * @ng2 Server Runner `Production`. */ require('./server')(9000);server { listen 80; # App Web Adress Listener server_name www.example.com example.com; location / { # Port where we have our daemon `pm2 start app.server.js` proxy_pass http://example.com:9000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } } - About Redis.
- Download and install latest stable version of Redis.
- Documentation about Redis.
After installation we need to start our server:
# start server $ src/redis-server- Redis Persistence
- Redis More Properties
- In progress
- In progress
| mgechev | ludohenin | greenkeeper[bot] | d3viant0ne | Shyam-Chen | vyakymenko |
| tarlepp | Nightapes | karlhaas | robstoll | TheDonDope | NathanWalker |
| hankehly | nareshbhatia | kiuka | fr-esco | salemdar | jesperronn |
| daniru | patrickmichalina | ArnaudPel | nhutcorp | netstart | nulldev07 |
| eppsilon | sasikumardr | aboeglin | gkalpak | markwhitfeld | Karasuni |
| sfabriece | ryzy | jerryorta-dev | treyrich | natarajanmca11 | e-oz |
| troyanskiy | nosachamos | pgrzeszczak | alllx | ArminZol | LuxDie |
| JakePartusch | admosity | JohnCashmore | larsthorup | ouq77 | Doehl |
| irsick | StefanKoenen | amedinavalencia | odk211 | tsm91 | domfarolino |
| juristr | jvitor83 | JayKan | ahmadqarshi | gotenxds | devanp92 |
| DmitriyPotapov | fisenkodv | emilio-simoes | evanplaice | JunaidZA | c-ice |
| markharding | maxmarkus | ojacquemart | rafaelss95 | turbohappy | TuiKiken |
| vogloblinsky | edud69 | idready | zbarbuto | Yonet | Green-Cat |
| ip512 | joshboley | Marcelh1983 | pbazurin-softheme | Bigous | rajeev-tripathi |
| alexweber | allenhwkim | yassirh | Falinor | amaltsev | tomlobato |
| arun-awnics | taguan | bbarry | bbogdanov | sonicparke | brendanbenson |
| brian428 | briantopping | ckapilla | cadriel | Cselt | dszymczuk |
| dmurat | peah90 | dstockhammer | DaveSkender | dwido | kayveedw |
| totev | JimbeanZN | ericdoerheit | gp187 | gsamokovarov | koodikindral |
| hkashlan | hpinsley | NN77 | isidroamv | aelbore | JohnnyQQQQ |
| jeffbcross | Drane | johnjelinek | JunusErgin | justindujardin | karlhiramoto |
| lihaibh | Brooooooklyn | tandu | inkidotcom | mpetkov | daixtrose |
| maxklenk | mjwwit | oferze | ocombe | gdi2290 | typekpb |
| pavlovich | philipooo | TTy32 | redian | robbatt | robertpenner |
| Sjiep | RoxKilly | SamVerschueren | sclausen | heavymery | na-oma |
| tapas4java | tsvetomir | valera-rozuvan | vincentpalita | VladimirMakaev | Yalrafih |
| arioth | billsworld | blackheart01 | butterfieldcons | danielcrisp | gforceg |
| jgolla | locinus | omerfarukyilmaz | ZuSe | rossedfort | ruffiem |
| savcha | tobiaseisenschenk | ultrasonicsoft | hellofornow |
You can follow the Angular change log here.
MIT