Skip to content

Instantly share code, notes, and snippets.

@mushfiq

mushfiq/.gitignore

Last active Dec 27, 2015
Embed
What would you like to do?
node_modules/*
<html>
<head>
</head>
<body>
Serving html from restify!
</body>
</html>
{
"name": "7271849",
"version": "0.0.1",
"description": "A sample application that shows how to serve static file using restify.",
"main": "api.js",
"dependencies": {
"restify": "~2.6.0"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js"
},
"repository": {
"type": "git",
"url": "https://gist.github.com/7271849.git"
},
"keywords": [
"restify",
"node.js",
"static"
],
"author": "Mushfiq-E Mahabub",
"license": "wtfpl",
"gitHead": "2c8e160f865cc11b2b09a5681b220c442a47ab17",
"bugs": {
"url": "https://gist.github.com/7271849"
}
}
var restify = require('restify');
var server = restify.createServer();
server.get(/.*/, restify.serveStatic({
'directory': '.',
'default': 'index.html'
}));
server.listen(8080, function() {
console.log('%s listening at %s', server.name, server.url);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.