This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type Valued<T> = { value: T } | |
| type ConfirmedMobile = Valued<string> & { status: 'confirmed' } | |
| type UnconfirmedMobile = Valued<string> & { status: 'unconfirmed' } | |
| type Mobile = ConfirmedMobile | UnconfirmedMobile | |
| type User { | |
| /* name, surname, etc */ | |
| mobile: Mobile | |
| } | |
| // an user with confirmed mobile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type Mobile { | |
| confirmed: boolean, | |
| value: string | |
| } | |
| type User { | |
| /* name, surname, etc */ | |
| mobile: Mobile | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pipelines: | |
| default: | |
| - step: | |
| name: Build | |
| image: node:10 | |
| script: | |
| - npm install | |
| - npm run build | |
| artifacts: | |
| - dist/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # install dependencies the first time | |
| npm install less http-server handlebars | |
| # build the website | |
| npm run build | |
| # serve files via http | |
| npm start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "scripts":{ | |
| "start": "http-server ./dist -p4000", | |
| "build": "node ./bin/build.js" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function compile() { | |
| clean() | |
| ensureDirectory('./dist') | |
| compileCSS() | |
| compileHTML() | |
| compileAssets() | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <VirtualHost *:80> | |
| ProxyPreserveHost On | |
| ServerName mysite.com | |
| <Location /> | |
| ProxyPass http://0.0.0.0:3000/ | |
| ProxyPassReverse http://0.0.0.0:3000/ | |
| RequestHeader set Connection "" | |
| </Location> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //navigation.js - centralized app navigation methods | |
| function isLoggedIn(fn){ | |
| return function() { | |
| if( /* test if the user is logged in */ ){ | |
| /* redirect to login page */ | |
| } else { | |
| var args = Array.prototype.slice.call(arguments); | |
| return fn && fn.apply(this, args); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //navigation.js - centralized app navigation methods | |
| exports.openHomePage = function(){ /* code for opening the Home page */ }; | |
| @isLoggedIn | |
| exports.openProfilePage = function(){ /* code for opening the Profile page */ }; | |
| @isLoggedIn | |
| exports.openDashboardPage = function(){ /* code for opening Dashboard page */ }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //navigation.js - centralized app navigation methods | |
| exports.openHomePage = function(){ /* code for opening the Home page */ }; | |
| exports.openProfilePage = function(){ /* code for opening the Profile page */ }; | |
| exports.openDashboardPage = function(){ /* code for opening Dashboard page */ }; | |
| exports.openInsightsPage = function(){ /* code for opening Insights page */ }; |