UNPKG

noide

Version:

Web Editor built on hapi and nes websockets using browserify, superviews.js, bootstrap and the ACE editor.

24 lines (22 loc) 505 B
var Joi = require('joi') var Boom = require('boom') var fileutils = require('../file-system-utils') module.exports = { method: 'GET', path: '/readfile', config: { handler: function (request, reply) { fileutils.readFile(request.query.path, function (err, data) { if (err) { return reply(Boom.badRequest('Read file failed', err)) } return reply(data) }) }, validate: { query: { path: Joi.string().required() } } } }