This repository contains the boilerplate code for you to start your first Quiver.js project. For more information refer to the build system documentation.
To get started, first clone the repository and run npm install.
$ git clone https://github.com/quiverjs/quiver-boilerplate my-quiver-project
$ cd my-quiver-project
$ npm install
$ npm test
This boilerplate uses Chai and Mocha to perform unit tests. Feel free to change it to any test framework that suits you.
$ npm start
Use npm start
to run the server. The default server simply returns "Hello World" in its response.
$ curl http://localhost:8080
Hello World
src/
contains your orginal source code.src/lib/
contains your library and component code.src/test/
contains your unit test files.src/server/
contains your server code and config.out/
contains the ES6-transpiled code from yoursrc
folder.package.json
contains default dependencies and build scripts to transpile ES6 code.index.js
is the entry point specified inpackage.json
and simply re-exports the transpiledlib/component.js
.
This boilerplate is designed for projects running as standalone web application. By convention the main handler component that will be run as server is simply exported as main
. server.js
simply load the main component from component.js
and run it as HTTP server.
For library projects that export quiver components for others to use, the server/
folder should be removed. The exported library components should also be given meaningful names other than main
.
This boilerplate uses npm scripts to automate the transpilation of ES6 code. You should update the package.json
to fit your project details. Remove the private
flag to publish your project to npm.