const nodester = require('nodester');
const app = new nodester();
app.listen(8080, function() {
console.log('listening on port', app.port);
});
const nodester = require('nodester');
const { buildConnection } = require('nodester/database/connection');
// Standard sequilize configuration:
// https://sequelize.org/docs/v6/getting-started/#connecting-to-a-database
const db = buildConnection({
host: ...,
port: ...,
name: ...,
username: ...,
password: ...,
dialect: ...,
pool: ...,
charset: ...,
collate: ...,
timestamps: ...,
logging: ...,
});
const app = new nodester();
app.set.database(db);
app.listen(8080, function() {
console.log('listening on port', app.port);
});
const serveStatic = require('serve-static');
const nodester = require('nodester');
const app = new nodester();
app.extend('static', serveStatic);
app.static(<path_to_static_directory/>);
Short:
const serveStatic = require('serve-static');
const nodester = require('nodester');
const app = new nodester();
app.extend('static', serveStatic)(<path_to_static_directory/>);
If you really want to override properties or use nodester
as a boilerplate, you should extend the default application class:
const NodesterApp = require('nodester');
class MyApp extends NodesterApp {
constructor(opts) {
super(opts)
}
// Override everything you want here...
}
// Don't forget to export.
module.exports = MyApp;
Copyright 2021-present Mark Khramko