-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
now using npm for typings added integration test updated project structure by adding services and config folders removed gulp
- Loading branch information
Sul
committed
Oct 15, 2016
1 parent
50c26ae
commit 2007623
Showing
26 changed files
with
278 additions
and
3,683 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Launch", | ||
"type": "node", | ||
"request": "launch", | ||
"program": "${workspaceRoot}/app/app.js", | ||
"stopOnEntry": false, | ||
"args": [], | ||
"cwd": "${workspaceRoot}", | ||
"preLaunchTask": null, | ||
"runtimeExecutable": null, | ||
"runtimeArgs": [ | ||
"--nolazy" | ||
], | ||
"env": { | ||
"NODE_ENV": "development" | ||
}, | ||
"console": "internalConsole", | ||
"sourceMaps": true, | ||
"outFiles": [] | ||
}, | ||
{ | ||
"name": "Attach", | ||
"type": "node", | ||
"request": "attach", | ||
"port": 5858, | ||
"address": "localhost", | ||
"restart": false, | ||
"sourceMaps": true, | ||
"outFiles": [], | ||
"localRoot": "${workspaceRoot}", | ||
"remoteRoot": null | ||
}, | ||
{ | ||
"name": "Attach to Process", | ||
"type": "node", | ||
"request": "attach", | ||
"processId": "${command.PickProcess}", | ||
"port": 5858, | ||
"sourceMaps": false, | ||
"outFiles": [] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Place your settings in this file to overwrite default and user settings. | ||
{ | ||
"explorer.openEditors.visible": 0, | ||
"files.exclude": { | ||
"**/.git": true, | ||
"**/.svn": true, | ||
"**/.hg": true, | ||
"**/.DS_Store": true, | ||
"app/**/*.js": true, | ||
"app/**/*.map": true, | ||
"test/**/*.js": true, | ||
"test/**/*.map": true | ||
}, | ||
"typescript.tsdk": "node_modules/typescript/lib" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import {Config} from '../types'; | ||
|
||
let env = process.env.NODE_ENV || 'development'; | ||
|
||
export let settings: Config = { | ||
name: 'restify-typescript-seed', | ||
version: '2.0.0', | ||
port: 3000, | ||
env: 'dev' | ||
}; | ||
|
||
if (env === 'production') { | ||
settings.env = 'prod'; | ||
// other production settings | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import * as bunyan from 'bunyan'; | ||
import * as stream from 'stream'; | ||
|
||
let infoStream = new stream.Writable(); | ||
infoStream.writable = true; | ||
|
||
infoStream.write = (info: any): boolean => { | ||
|
||
console.log(JSON.parse(info).msg); | ||
return true; | ||
}; | ||
|
||
export let logger = bunyan.createLogger({ | ||
name: 'myapp', | ||
streams: [ | ||
{ | ||
level: 'info', | ||
stream: infoStream | ||
}, | ||
{ | ||
level: 'error', | ||
path: `error.log` | ||
} | ||
] | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export interface Config { | ||
name: string; | ||
port: number; | ||
env: string; | ||
version: string; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
test/integration/controllers/SampleRouteController.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import chai = require('chai'); | ||
import { api as server } from '../../../app/app'; | ||
import * as supertest from 'supertest'; | ||
|
||
let expect = chai.expect; | ||
|
||
describe('sample route controller', () => { | ||
|
||
it('should return pong', (done) => { | ||
supertest(server) | ||
.get('/api/ping') | ||
.end((err: any, response: supertest.Response) => { | ||
if (err) { | ||
done(err); | ||
} | ||
else { | ||
expect(response.status).to.equal(200); | ||
expect(response.body).to.equal('pong'); | ||
done(); | ||
} | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.