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
FROM ubuntu:14.04 | |
MAINTAINER Fran Rios [email protected] | |
# to avoid some problems: | |
# debconf: unable to initialize frontend: Dialog | |
ENV DEBIAN_FRONTEND noninteractive | |
# Install Nodejs... | |
RUN apt-get update && apt-get install -y nodejs npm |
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
language: node_js | |
sudo: false | |
node_js: | |
- "4.2.1" | |
after_success: | |
- | | |
curl -H "Content-Type: application/json" --data '{"build": true}' -X POST https://registry.hub.docker.com/u/fcojriosbello/testingndeploying/trigger/4fcbd380-e094-4c28-9bab-95f7fe62001a/ |
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
const gulp = require('gulp') | |
const mocha = require('gulp-mocha') | |
const bg = require('gulp-bg') | |
var bgstart | |
gulp.task('start', bgstart = bg('node', './index.js')) | |
gulp.task('test', ['start'], function () { | |
return gulp.src('./test/test.js', {read: false}) | |
.pipe(mocha({reporter: 'nyan'})) |
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
var request = require('request') | |
var expect = require('chai').expect | |
describe('Server response', function () { | |
it('should return 200', function (done) { | |
request.get('http://localhost:8080/', function (err, res, body) { | |
if (err) throw err | |
expect(res.statusCode).to.equal(200) | |
done() | |
}) |
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
var express = require('express') | |
var app = express() | |
app.get('/', function (req, res) { | |
res.status(200).send('root path of the project! (Testing redeploy)\n') | |
}) | |
app.listen(8080, function () { | |
console.log('App listening at localhost:8080') | |
}) |
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
var http = require('http') | |
http.createServer(function (req, res) { | |
var body = '' | |
req.setEncoding('utf8') | |
req.on('data', function (chunk) { | |
body += chunk | |
}) |
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
var http = require('http') | |
var server = http.createServer().listen(8080, function () { | |
console.log('Listening on port 8080...') | |
}) | |
server.on('request', function (req, res) { | |
res.write('Hello from Node.js fundamentals!\n') | |
res.end() | |
}) |
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
var http = require('http') | |
http.createServer(function (req, res) { | |
res.write('Hello from Node.js fundamentals!\n') | |
res.end() | |
}).listen(8080, function () { | |
console.log('Listening on port 8080...') | |
}) |
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
var fs = require ('fs') | |
fs.readFile('README.md', function (err, asyncData) { | |
if (err) throw err | |
console.log(asyncData.toString()) | |
}) | |
console.log('It is not blocked') |
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
var fs = require('fs') | |
var syncData = fs.readFileSync('README.md').toString() | |
console.log(syncData) | |
console.log('It is blocked') |
NewerOlder