This page introduces you to the humble.js server which is the core of humble framework.
humblejs-repo
CLI) to speed up the development.__
you should be able to smoothly update to latest version of humble.js simply by doing yarn humblejs:update
from the root.mysql
by default) and provides you features to query the records without having to write your schema etc. This also means SQL injection prevention without having to worry about it.Humble.js is focused on isomorphic javascript development, helping you make it all with javascript, from database layer to api to frontend rendering and styling.
Hopefully, soon there will be a fully working demo up and running where you will be able to experience a lot of humble.js’s built-in features.
Smooth development is one of the main reasons why you would want to use it instead of writing your own. Humble.js follows a specific pattern that makes your application highly efficient for development across many teams.
fetch
calls with mocked responses.controllers
) which will generate props for the component.req, res, next
@yourapp/theme
) and the changes will be immediately visible in the component demo and can easily be updated on server by simply re-generating yarn.lock
.@humble.js/link
for all your links in frontend components (similar to <a>
). You do not need to do anything special for this, no need to use special library or inject a script.With release of version 2, the development is even easier. Each service is in it’s own directory/package and does not depend on one another. The only time it depends is when they actually need to talk to each other, but that’s mostly the last step because you would use RESTful client to test your package (unless you take TDD approach which we highly recommend).
Humble.js comes with debugging support
firebug
or Chrome Dev Tools
--inspect
flaghumble.config.js
is the base file for your project’s humble.js implementation. This is javascript file instead of plain json file. This gives you flexibility of using external dev
packages.
Config Name | Description |
---|---|
scope |
Packages scope for your project. This is used when creating new packages, upgrading the packages and while building |
version |
Version of your app. You wouldn’t change package.json ’s version, as that is specific for the humble.js’s (the server framework) version |
remote |
Object that specifies the remote config. name , user , host , port , dest , privateKey and keep are the possible properties of this object. This is used with @humblejs/server deployment process |
serviceWorker |
Configuration related to service worker and progress web app. enabled , cacheControllers and cacheUrls |
pageMapping |
Page to package mapping for custom pages. For example, if some of the pages do not use packages from scope , you can specify here. |
disabledApi |
You can disable any humble.js built-in API by adding the identifier here. For example ['USERS.SIGNUP'] will disable signup API, ['USERS'] will disable all the user related API (signin , signup etc) |
module.exports = {
scope: 'sample', // allows packages like @sample/pa-homepage
version: '1.0.0', // your app version
deployments: {
default: {
port: 3080,
cronmasterPort: 9000,
pmaPort: 3084,
stack: [
'__docker-stack.yml',
'__docker-stack-crons.yml',
'__docker-stack.prod.yml',
],
},
},
// any custom mapping for your components that do not use humble.js's
// defined format (i.e, @SCOPE/pa-<PAGE_NAME>)
pageMapping: {
Homepage: 'fe-pa-homepage',
},
// Any API you want to disable (that come default with humble.js)
disabledApi: [
],
serviceWorker: {
enabled: false,
cacheControllers: [
// list of controllers to cache by service worker
{ url: '/', controllerId: 'homepage' },
{ url: '/about', controllerId: 'about' },
],
cacheUrls: [
// list of urls to cache by service worker
],
},
};