adonis-framework
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "adonis-framework", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Adonis framework a loosely coupled http server for adonis application, it does all the required hard work to setup a managable http server with depdendency injection in place.", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "iojs maketest", | ||
"test": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec test/integration test/unit && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage", | ||
"selenium": "iojs makeselenium", | ||
"coverage": "iojs makecoverage" | ||
"coverage": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec test/integration test/unit && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage" | ||
}, | ||
@@ -42,2 +42,3 @@ "author": "adonisjs", | ||
"chai-string": "^1.1.2", | ||
"coveralls": "^2.11.4", | ||
"formidable": "^1.0.17", | ||
@@ -48,2 +49,3 @@ "hippie": "^0.3.0", | ||
"mocha": "^2.2.5", | ||
"mocha-lcov-reporter": "0.0.2", | ||
"nightwatch": "^0.7.11", | ||
@@ -50,0 +52,0 @@ "raw-body": "^2.1.2", |
@@ -10,3 +10,2 @@ 'use strict' | ||
const ServiceProvider = require('adonis-fold').ServiceProvider | ||
const Env = require('../src/Env') | ||
@@ -30,2 +29,3 @@ class EnvProvider extends ServiceProvider { | ||
this.app.singleton('Adonis/Src/Env', function (Helpers) { | ||
const Env = require('../src/Env') | ||
return new Env(Helpers) | ||
@@ -32,0 +32,0 @@ }) |
@@ -10,3 +10,2 @@ 'use strict' | ||
const ServiceProvider = require('adonis-fold').ServiceProvider | ||
const Namespace = require('../src/Namespace') | ||
@@ -30,2 +29,3 @@ class NamespaceProvider extends ServiceProvider { | ||
this.app.singleton('Adonis/Src/Namespace', function (Env, Helpers) { | ||
const Namespace = require('../src/Namespace') | ||
return new Namespace(Env, Helpers) | ||
@@ -32,0 +32,0 @@ }) |
@@ -10,3 +10,2 @@ 'use strict' | ||
const ServiceProvider = require('adonis-fold').ServiceProvider | ||
const Request = require('../src/Request') | ||
@@ -21,3 +20,3 @@ class RequestProvider extends ServiceProvider { | ||
this.app.bind('Adonis/Src/Request', function () { | ||
return Request | ||
return require('../src/Request') | ||
}) | ||
@@ -24,0 +23,0 @@ } |
@@ -10,3 +10,2 @@ 'use strict' | ||
const ServiceProvider = require('adonis-fold').ServiceProvider | ||
const Response = require('../src/Response') | ||
@@ -30,2 +29,3 @@ class ResponseProvider extends ServiceProvider { | ||
this.app.singleton('Adonis/Src/Response', function (View) { | ||
const Response = require('../src/Response') | ||
return new Response(View) | ||
@@ -32,0 +32,0 @@ }) |
@@ -10,3 +10,2 @@ 'use strict' | ||
const ServiceProvider = require('adonis-fold').ServiceProvider | ||
const Server = require('../src/Server') | ||
@@ -30,2 +29,3 @@ class ServerProvider extends ServiceProvider { | ||
this.app.bind('Adonis/Src/Server', function (Route,Request,Response,Logger) { | ||
const Server = require('../src/Server') | ||
return new Server(Route,Request,Response,Logger) | ||
@@ -32,0 +32,0 @@ }) |
@@ -10,3 +10,2 @@ 'use strict' | ||
const ServiceProvider = require('adonis-fold').ServiceProvider | ||
const View = require('../src/View') | ||
@@ -30,2 +29,3 @@ class ViewProvider extends ServiceProvider { | ||
this.app.singleton('Adonis/Src/View', function (Helpers,Env,Route) { | ||
const View = require('../src/View') | ||
return new View(Helpers,Env,Route) | ||
@@ -32,0 +32,0 @@ }) |
# Adonis Http Dispatcher | ||
# Adonis framework | ||
Adonis http dispatcher powers http layer for adonis framework. You must visit adonis website to read documentation. | ||
![travis-build](https://img.shields.io/travis/adonisjs/adonis-framework.svg) | ||
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard) | ||
[![Coverage Status](https://coveralls.io/repos/adonisjs/adonis-framework/badge.svg?branch=master&service=github)](https://coveralls.io/github/adonisjs/adonis-framework?branch=master) | ||
Adonis is a NodeJs MVC framework for humans, it is built on solid foundations making it easier to write server applications. | ||
## Docs | ||
Please visit [adonisjs.com](http://adonisjs.com) to read more. |
@@ -40,4 +40,4 @@ 'use strict' | ||
* and set required paths and namespace based on same. | ||
* @param {String} packagePath [description] | ||
* @return {void} [description] | ||
* @param {String} packagePath | ||
* @return {void} | ||
* @public | ||
@@ -87,4 +87,4 @@ */ | ||
Helpers.publicPath = function (toFile) { | ||
const configDir = './public' | ||
const incrementalPath = typeof(toFile) !== 'undefined' ? `/${configDir}/${toFile}` : configDir | ||
const toDir = './public' | ||
const incrementalPath = typeof(toFile) !== 'undefined' ? `/${toDir}/${toFile}` : toDir | ||
return Helpers._makePath(rootPath,incrementalPath) | ||
@@ -111,4 +111,4 @@ } | ||
Helpers.configPath = function (toFile) { | ||
const configDir = './config' | ||
const incrementalPath = typeof(toFile) !== 'undefined' ? `/${configDir}/${toFile}` : configDir | ||
const toDir = './config' | ||
const incrementalPath = typeof(toFile) !== 'undefined' ? `/${toDir}/${toFile}` : toDir | ||
return Helpers._makePath(rootPath,incrementalPath) | ||
@@ -124,4 +124,4 @@ } | ||
Helpers.storagePath = function (toFile) { | ||
const configDir = './storage' | ||
const incrementalPath = typeof(toFile) !== 'undefined' ? `/${configDir}/${toFile}` : configDir | ||
const toDir = './storage' | ||
const incrementalPath = typeof(toFile) !== 'undefined' ? `/${toDir}/${toFile}` : toDir | ||
return Helpers._makePath(rootPath,incrementalPath) | ||
@@ -137,4 +137,4 @@ } | ||
Helpers.resourcesPath = function (toFile) { | ||
const configDir = './resources' | ||
const incrementalPath = typeof(toFile) !== 'undefined' ? `/${configDir}/${toFile}` : configDir | ||
const toDir = './resources' | ||
const incrementalPath = typeof(toFile) !== 'undefined' ? `/${toDir}/${toFile}` : toDir | ||
return Helpers._makePath(rootPath,incrementalPath) | ||
@@ -144,2 +144,14 @@ } | ||
/** | ||
* @function migrationsPath | ||
* @description returns path to migrations directory | ||
* @param {String} toFile | ||
* @return {Strings} | ||
*/ | ||
Helpers.migrationsPath = function (toFile) { | ||
const toDir = './migrations' | ||
const incrementalPath = typeof(toFile) !== 'undefined' ? `/${toDir}/${toFile}` : toDir | ||
return Helpers._makePath(rootPath,incrementalPath) | ||
} | ||
/** | ||
* @function viewsPath | ||
@@ -146,0 +158,0 @@ * @description returns reference to views directory |
@@ -10,3 +10,3 @@ 'use strict' | ||
const fold = require('adonis-fold') | ||
const Registerar = fold.Registerar | ||
const Ioc = fold.Ioc | ||
@@ -24,23 +24,12 @@ /** | ||
/** | ||
* @function register | ||
* @description registers autoloading config to process.env | ||
* and autoloads given directory under a defined namespace | ||
* @param {Object} packageFile | ||
* @return {void} | ||
* @function autoload | ||
* @description register appNameSpace and dir to | ||
Ioc container | ||
*/ | ||
Namespace.prototype.autoload = function () { | ||
const self = this | ||
return new Promise(function (resolve, reject) { | ||
const appDir = self.helpers.appPath() | ||
const foldNamespace = self.helpers.appNameSpace() | ||
if (self.env.get('AUTOLOAD')) { | ||
Registerar.autoload(appDir, appDir, foldNamespace).then(resolve).catch(reject) | ||
} else { | ||
resolve() | ||
} | ||
}) | ||
const appDir = this.helpers.appPath() | ||
const foldNamespace = this.helpers.appNameSpace() | ||
Ioc.dumpSettings(appDir,foldNamespace) | ||
} | ||
module.exports = Namespace |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
62113
44
2195
13
13