Posts

Creating a simple api mock service in Aurelia-cli

Introduction In the last weeks I faced the challenge, that our central development API had several bugs so that I was not able to request it. So I created a simple mock-service in aurelia-cli. Besides the fact that the mock-service enabled me to work on, this setup has the big advantage, that the development environment is now completely independent. Following a rough guide, how I created the mock service. How To Add aurelia-configuration plugin to project First, I added the aurelia-configuration plugin to my project. Besides the advantage that this component enables me to have all configurations in one central place, I am now able to have stage dependent configurations and I don't need to care about staging anymore. Install aurelia-configuration by running "npm install aurelia-configuration --save" Configure plugin in main.ts .plugin('aurelia-configuration', config => { config.setEnvironments({ development: ['lo

Connecting native Database-Client to Docker SQL-Container using Docker-Toolbox

Image
Attention : This post only handles "Docker Toolbox". If possible use "Docker for Windows"! "Docker Toolbox" is a workaround for Windows Home that doesn't provide the "Hyper-V"-Feature. In one of our projects, my team is developing a new dockerized plattform. Dockerized means, that we split the infrastructure into seperate images like web, php and database. My team is developing on the ubuntu os with a native docker client. I’m working on a windows 10 using the docker-toolbox . Overall we have central docker-compose scripts to combine all images to one working infrastructure. Following a snippet of our database (mariadb) composer configuration: mysql: image : mariadb: 10.1 ports: - "127.0.0.1:3306:3306" environment: MYSQL_DATABASE: <projectname> MYSQL_ROOT_PASSWORD: pw volumes: - <projectname>-mysqldata:/var/lib/mysql networks: - back logging: options:

How to create a custom Task using Aurelia-CLI

First of all you need to understand, how the Aurelia-CLI works and how it is usually structured. For our example we’re going to setup gulp-imagemin. Having an atomic structure where each class, service or task has dedicated responsibilities has many advantages like the following ones: You’ll always have an overview about your application, You can structure your application well with clear responsibilities, Everyone can understand your code fast and your application is more stable and maintainable. For everyone! Install gulp-imagemin To be able to setup our custom task for minifying our images, we need to install gulp-imagemin first. This can be done by the following command: au install gulp-imagemin On success this application is now listed in aurelia_project/aurelia.json . Create a Task using Aurelia-CLI console In this case my task is called “process-images”. au generate task process -images This command creates a file ‘process-images.ts’ in the default aurelia dir