Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Commit

Permalink
feat(*): initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Aug 9, 2017
0 parents commit da77526
Show file tree
Hide file tree
Showing 12 changed files with 4,650 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
@@ -0,0 +1,13 @@
# editorconfig.org
root = true

[*]
indent_size = 2
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
8 changes: 8 additions & 0 deletions .gitignore
@@ -0,0 +1,8 @@
coverage
node_modules
.DS_Store
npm-debug.log
.idea
out
.nyc_output
test/tmp
12 changes: 12 additions & 0 deletions .npmignore
@@ -0,0 +1,12 @@
coverage
node_modules
.DS_Store
npm-debug.log
test
.travis.yml
.editorconfig
benchmarks
.idea
bin
out
.nyc_output
10 changes: 10 additions & 0 deletions .travis.yml
@@ -0,0 +1,10 @@
language: node_js
node_js:
- node
- 7.0.0
sudo: false
install:
- npm install
notifications:
slack:
secure: m91zkX2cLVDRDMBAUnR1d+hbZqtSHXLkuPencHadhJ3C3wm53Box8U25co/goAmjnW5HNJ1SMSIg+DojtgDhqTbReSh5gSbU0uU8YaF8smbvmUv3b2Q8PRCA7f6hQiea+a8+jAb7BOvwh66dV4Al/1DJ2b4tCjPuVuxQ96Wll7Pnj1S7yW/Hb8fQlr9wc+INXUZOe8erFin+508r5h1L4Xv0N5ZmNw+Gqvn2kPJD8f/YBPpx0AeZdDssTL0IOcol1+cDtDzMw5PAkGnqwamtxhnsw+i8OW4avFt1GrRNlz3eci5Cb3NQGjHxJf+JIALvBeSqkOEFJIFGqwAXMctJ9q8/7XyXk7jVFUg5+0Z74HIkBwdtLwi/BTyXMZAgsnDjndmR9HsuBP7OSTJF5/V7HCJZAaO9shEgS8DwR78owv9Fr5er5m9IMI+EgSH3qtb8iuuQaPtflbk+cPD3nmYbDqmPwkSCXcXRfq3IxdcV9hkiaAw52AIqqhnAXJWZfL6+Ct32i2mtSaov9FYtp/G0xb4tjrUAsDUd/AGmMJNEBVoHtP7mKjrVQ35cEtFwJr/8SmZxGvOaJXPaLs43dhXKa2tAGl11wF02d+Rz1HhbOoq9pJvJuqkLAVvRdBHUJrB4/hnTta5B0W5pe3mIgLw3AmOpk+s/H4hAP4Hp0gOWlPA=
22 changes: 22 additions & 0 deletions appveyor.yml
@@ -0,0 +1,22 @@
environment:
matrix:
- nodejs_version: 'Stable'
- nodejs_version: '7'

init:
git config --global core.autocrlf true

install:
- ps: Install-Product node $env:nodejs_version
- npm install

test_script:
- node --version
- npm --version
- npm run test:win

build: off
clone_depth: 1

matrix:
fast_finish: true
40 changes: 40 additions & 0 deletions bin/index.js
@@ -0,0 +1,40 @@
'use strict'

/*
* adonis-framework
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

const semver = require('semver')
const { spawn } = require('child_process')
const spawnArgs = []

if (semver.lt(process.version, '8.0.0')) {
spawnArgs.push('--harmony-async-await')
}

function local () {
spawnArgs.push('./node_modules/.bin/japa')
const tests = spawn('node', spawnArgs)
tests.stdout.on('data', (data) => process.stdout.write(data))
tests.stderr.on('data', (data) => process.stderr.write(data))
tests.on('close', (code) => process.exit(code))
}

function win () {
spawnArgs.push('./node_modules/japa-cli/index.js')
const tests = spawn('node', spawnArgs)
tests.stdout.on('data', (data) => process.stdout.write(data))
tests.stderr.on('data', (data) => process.stderr.write(data))
tests.on('close', (code) => process.exit(code))
}

if (process.argv.indexOf('--local') > -1) {
local()
} else if (process.argv.indexOf('--win') > -1) {
win()
}
87 changes: 87 additions & 0 deletions example/cors.js
@@ -0,0 +1,87 @@
'use strict'

module.exports = {
/*
|--------------------------------------------------------------------------
| Origin
|--------------------------------------------------------------------------
|
| Set a list of origins to be allowed. The value can be one of the following
|
| Boolean: true - Allow current request origin
| Boolean: false - Disallow all
| String - Comma seperated list of allowed origins
| Array - An array of allowed origins
| String: * - A wildcard to allow current request origin
| Function - Receives the current origin and should return one of the above values.
|
*/
origin: false,

/*
|--------------------------------------------------------------------------
| Methods
|--------------------------------------------------------------------------
|
| HTTP methods to be allowed. The value can be one of the following
|
| String - Comma seperated list of allowed methods
| Array - An array of allowed methods
|
*/
methods: ['GET', 'PUT', 'POST'],

/*
|--------------------------------------------------------------------------
| Headers
|--------------------------------------------------------------------------
|
| List of headers to be allowed via Access-Control-Request-Headers header.
| The value can be on of the following.
|
| Boolean: true - Allow current request headers
| Boolean: false - Disallow all
| String - Comma seperated list of allowed headers
| Array - An array of allowed headers
| String: * - A wildcard to allow current request headers
| Function - Receives the current header and should return one of the above values.
|
*/
headers: true,

/*
|--------------------------------------------------------------------------
| Expose Headers
|--------------------------------------------------------------------------
|
| A list of headers to be exposed via `Access-Control-Expose-Headers`
| header. The value can be on of the following.
|
| Boolean: false - Disallow all
| String: Comma seperated list of allowed headers
| Array - An array of allowed headers
|
*/
exposeHeaders: false,

/*
|--------------------------------------------------------------------------
| Credentials
|--------------------------------------------------------------------------
|
| Define Access-Control-Allow-Credentials header. It should always be a
| boolean.
|
*/
credentials: false,

/*
|--------------------------------------------------------------------------
| MaxAge
|--------------------------------------------------------------------------
|
| Define Access-Control-Allow-Max-Age
|
*/
maxAge: 90
}

0 comments on commit da77526

Please sign in to comment.