diff --git a/lib/index.js b/lib/index.js index c902ecd..460b56e 100644 --- a/lib/index.js +++ b/lib/index.js @@ -30,7 +30,7 @@ export default new class { console.log(); - console.log(`${chalk.yellow('exa.js')} by tux - v0.0.5`); + console.log(`${chalk.yellow('exa.js')} by tux - v0.0.9`); console.log('-----------------------------'); console.log(`${chalk.green(DateTime.now().toISO())}`); console.log('-----------------------------'); diff --git a/license b/license index 329ed70..b008116 100644 --- a/license +++ b/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022-2024 Brian Seymour +Copyright (c) 2024-Present Brian Seymour Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/package.json b/package.json index 9a305b0..8e6411a 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@exajs/core", "type": "module", "author": "Brian Seymour <@realtux>", - "version": "0.0.8", + "version": "0.0.9", "description": "modern opinionated node.js framework", "license": "MIT", "homepage": "https://github.com/realtux/exa", diff --git a/var/template/config/master.js b/var/template/config/master.js index 1bc6e9e..d75939b 100644 --- a/var/template/config/master.js +++ b/var/template/config/master.js @@ -61,7 +61,7 @@ export default { /** * user defined custom configuration - * add anything you'd like + * add anything you'd like to be avaiable at exa.config.* */ }; diff --git a/var/template/docker.sh b/var/template/docker.sh index d695532..2f43593 100755 --- a/var/template/docker.sh +++ b/var/template/docker.sh @@ -4,8 +4,7 @@ . .env # switch to current directory -scriptdir=$(dirname "$0") -cd $scriptdir +cd $(dirname "$0") case $* in console* ) diff --git a/var/template/http/api/hello.js b/var/template/http/api/hello.js index 69eec6d..3433e6f 100644 --- a/var/template/http/api/hello.js +++ b/var/template/http/api/hello.js @@ -1,10 +1,14 @@ +import sample from '#app/models/sample.js'; + export default new class { routes = { 'get /api/hello/world': 'world', } - world(req, res) { + async world(req, res) { + sample.model_method(); + return res .status(200) .send({ diff --git a/var/template/http/two.js b/var/template/http/home.js similarity index 88% rename from var/template/http/two.js rename to var/template/http/home.js index 9f6283d..8dee278 100644 --- a/var/template/http/two.js +++ b/var/template/http/home.js @@ -4,7 +4,7 @@ export default new class { 'get /home': 'home', } - home(req, res) { + async home(req, res) { return res .status(200) .render('sample.html', { diff --git a/var/template/models/sample.js b/var/template/models/sample.js index ae7d7c5..eba3633 100644 --- a/var/template/models/sample.js +++ b/var/template/models/sample.js @@ -21,6 +21,10 @@ class sample extends Model { } } + static model_method() { + console.log('calling sample.model_method()'); + } + } export default sample;