-
Notifications
You must be signed in to change notification settings - Fork 21
simple tcp server #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| GET / HTTP/1.1 | ||
| Host: localhost:3000 | ||
| User-Agent: curl/7.43.0 | ||
| Accept: */* | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| var gulp = require('gulp'); | ||
| var jshint = require('gulp-jshint'); | ||
| var mocha = require('gulp-mocha'); | ||
| var appFiles =['lib/**/*.js',]; | ||
| var testFiles = ['./test/**/*.js']; | ||
| var watchFiles = ['./*.js', 'lib/**/*.js', './test/**/*.js']; | ||
|
|
||
| gulp.task('jshint:test', function(){ | ||
| return gulp.src(testFiles) | ||
| .pipe(jshint({ | ||
| node: true, | ||
| globals: { | ||
| describe: true, | ||
| it: true, | ||
| before: true, | ||
| after: true | ||
| } | ||
| })) | ||
| .pipe(jshint.reporter('default')); | ||
| }); | ||
|
|
||
| gulp.task('jshint:app', function() { | ||
| return gulp.src(appFiles) | ||
| .pipe(jshint({ | ||
| node: true | ||
| })) | ||
| .pipe(jshint.reporter('default')); | ||
| }); | ||
|
|
||
| gulp.task('mocha:test', function() { | ||
| return gulp.src(testFiles) | ||
| .pipe(mocha({ | ||
| node: true, | ||
| globals: { | ||
| describe: true, | ||
| it: true, | ||
| before: true, | ||
| after: true | ||
| } | ||
| })) | ||
| .pipe(mocha({reporter:'spec'})); | ||
| }); | ||
|
|
||
| gulp.task('default', ['watch']); | ||
|
|
||
| gulp.task('watch', function(){ | ||
| gulp.watch(watchFiles, ['jshint'], ['mocha']); | ||
| }); | ||
|
|
||
| gulp.task('jshint', ['jshint:test', 'jshint:app']); | ||
| gulp.task('mocha', ['mocha:test']); | ||
| gulp.task('default', ['jshint', 'mocha']); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| var net = require('net'); | ||
| var fs = require('fs'); | ||
|
|
||
| var server = net.createServer(function(socket) { | ||
| var d = new Date(); | ||
| socket.pipe(fs.createWriteStream(d + '_message.txt')); | ||
| }); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pretty straight forward task, but looks good. and your code styling looks great |
||
|
|
||
| server.listen('3000', function(){ | ||
| console.log('server up'); | ||
| }); | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good