term
cd Web/
touch server.js
server.js
| var express = require('express'); | |
| var router = express.Router(); | |
| /* GET home page. */ | |
| router.get('/', function(req, res, next) { | |
| res.render('index', { title: 'Express' }); | |
| }); | |
| var users = { |
| var stream = require('stream'); | |
| // Initiate the source | |
| var bufferStream = new stream.PassThrough(); | |
| // Write your buffer | |
| bufferStream.end(new Buffer('Test data.')); | |
| // Pipe it to something else (i.e. stdout) | |
| bufferStream.pipe(process.stdout); |
| (($) -> | |
| options = | |
| videoId: "youtube video id" | |
| width: "640" | |
| height: "480" | |
| playerVars: | |
| autoplay: 0 | |
| controls: 1 | |
| modestbranding: 0 |
I freaking love working with technologies like Grunt and Gulp, and wanted to share how to get my current EE front-end workflow set up. With a few tweaks, this can also be used with virtually any other sites (I've used it with Laravel, static sites, Craft, etc).
| #!/bin/bash | |
| for FILE in `find . -name "*.js" -type f -o -path './node_modules' -prune -o -path './components' -prune` | |
| do | |
| if [ -e $FILE ] ; then | |
| COFFEE=${FILE//.js/.coffee} | |
| echo "converting ${FILE} to ${COFFEE}" | |
| js2coffee "$FILE" > "$COFFEE" | |
| else |
聲明: 此並非爲官方聲明。我並非爲 io.js 官方代表,如果有任何問題,歡迎在 node-forward 一起討論
| app = angular.module("myApp", ["service.create"]) |
| <div class="container" ng-app ng-controller="rootController"> | |
| <form action="/comment/create" method="POST" id="message-form"> | |
| <div class="form-group"> | |
| <input type="text" id="messge" ng-model="message" name="comments" placeholder="input comments ..." > | |
| </div> | |
| <button type="submit" class="btn btn-success">comment</button> | |
| </form> | |
| <div class="message"> |
| var http = require("http"); | |
| var port = 1337; | |
| http.createServer(function (req, res) { | |
| res.end("OK"); | |
| }).listen(port); | |
| console.log("Start server port is " + port ); |