Agnostic JS framework that empowers devs to focus on quickly building apps, rather than focusing on application config, health-checks, application structure, or architecture to build a 12 factor app in Docker.
npm install spawnpoint!Spawnpoint Logo





npm install spawnpoint --save
``javascript
// ~/app.js
const spawnpoint = require('spawnpoint');
const app = new spawnpoint();
app.setup();
`
`javascript`
// ~/config/app.json
{
"name": "Example App",
"plugins": [
"spawnpoint-express", // this creates an express server
"spawnpoint-redis" // this establishes a connection to a redis server via redisio
],
"autoload": [
// this autoloads all js files in the ~/controllers folder
{
"name": "Controllers",
"folder": "controllers"
}
]
}
`javascriptuser:${req.params.id}
// ~/controllers/app.js
module.exports = (app) => {
// express is already setup and configured via JSON
app.server.get('/user/:id', (req, res) => {
// redis is already connected and ready
app.redis.get(, (err, results) => {
if(err){ res.fail(err); } // automatic error handling
// return JSON formated success with a success code
res.success('users.list', {
user: JSON.parse(results)
});
});
});
};
`
- Express - Express: web server
- Redis - Redis: Key/value database/store
- RethinkDB - RethinkDB: - NoSQL document database
- NATS - Nats.io: Pub/Sub Message Queue
- Building 12 factor apps
- Auto-loading multiple folders for product folder structure
- File require() recursion management overhead ?--command="args"
- Support basic that override config files
- ENV variables that override config files
- Docker Secrets that override config files
- Dev config overrides
- Rebuilding a basic JSON REST API via express
- Database connect/reconnect management
- Healthchecks
- Application lifecycle
- Tracks app startup
- Graceful shutdown
- Making a Docker friendly NodeJS app
. All system models, libraries, and config are hoisted to this variable with several namespaces:######
app.config
All application config is mounted here. For example app.config.express is where all configuration is available to the spawnpoint-express plugin.######
app.status
Tracks the current application lifecycle.######
app.containerized
Detects if app is running in a container.######
app.cwd
Returns the main folder where your application lives.#### Hoisting your own Libraries
When you hoist your library on the
app variable you can access it on any other autoloaded js file.
`javascript
module.exports = (app) => {
app.yourLibName = {
add(a, b){
return a + b;
}
};
}
`
`javascript
app.server.post('/add', (req, res) => {
// redis is already connected and ready
let results = app.yourLibName.add(req.body.a, req.body.b);
res.success('math.add', {
results: results
});
});``