Yet another web framework experiment.
$ yarn add @becquerel/framework # Or alternately: `npm install @becquerel/framework`'use strict';
const Bq = require('@becquerel/framework');
const app = new Bq();
app.route('/', {
get: (request, response) => {
response.json = {hello: 'world'};
}
});
app.route('/hello', {
get: (request, response) => {
response.html = '<p>...world</p>';
}
});
app.route('/hello/{var}', {
get: (request, response) => {
response.json = {valueOfVar: request.uriVariables.var};
}
});
app.run();The default charset used for framework responses.
The port that the app will bind to if settings.port is not passed to #run().
If true the app will display the Now listening at <${uri}>. message upon launch.
$ yarn test # Or alternatively: `npm test`The MIT License (Expat). See the license file for details.