This is the microapp seed, which uses:
A micro-app is designed to be loaded into the content area of the AppHub.
The stack is completely new and will change the way you develop applications.
After you clone the repo.
- Install npm dependencies
$ npm install
- Install bower depenencies
$ npm run bower
Note: This will be depricated as bower is no longer maintained.
- Start NodeJS development server with Webpack middleware
$ npm run dev
- Test client/server
$ npm test
Executes testing using Jest with Snapshots and Code Coverage
- Build client/server for production
$ npm run dist
Note: This command will produce (
dist
andapphub-microapp-seed.x.x.x.zip
) artifact to be deployed.
- Deploy to Cloud Foundry
$ npm run deploy
Note: This runs the
dist
command and deploys the contents of the./dist
directory.
Here is how to build and run this app as a docker container.
- Build and run the image:
$ npm run docker:build
$ npm run docker:run
- Print the output of your app:
# Get container ID
$ docker ps
# Print app output
$ docker logs <container-id>
- Execute commands inside the image:
$ docker exec -it <container-id> /bin/bash
- Test api access to the container:
$ curl -i localhost:49160/api
- To build using
docker-compose
simply use:
$ docker-compose up
The testing setup is pre-configured to run:
test
- executes Jest on all ./src/**/*.test.js files.test:e2e
- executes NightwatchJS on all ./test/e2e/specs/**/*.js files.
To run unit tests using Jest execute the following:
$ npm test
You will get detailed code coverage in the
coverage
directory.
To run e2e tests launch your application and in a separate terminal execute the following:
$ npm run test:e2e
NightwatchJS - http://nightwatchjs.org