Sha256: bb7d043d81d7313c32ff0dc924f74c750748027989df121553410e91bfb2568a
Contents?: true
Size: 632 Bytes
Versions: 1
Compression:
Stored size: 632 Bytes
Contents
#!/usr/bin/env node var fs = require('fs'); var express = require('express'); var bodyParser = require('body-parser'); var serveStatic = require('serve-static'); var app = express(); app.use(bodyParser.urlencoded({ extended: false })) app.use(bodyParser.json()) // serving script file app.use(serveStatic(__dirname + '/public', { maxAge: '1d' })) // serving script file app.get('/code-snippet.js', function(req, res) { fs.createReadStream('../../code-snippet.js').pipe(res); }); // post target app.post('/target', function(req, res) { res.send('data received: ' + JSON.stringify(req.body)); }); app.listen(3000);
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
tui_editor-rails-1.0.2.0 | vendor/assets/components/tui-code-snippet/demo/postBridge/server.js |