Last active
December 27, 2015 05:09
-
-
Save mushfiq/7271849 to your computer and use it in GitHub Desktop.
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
node_modules/* |
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
<html> | |
<head> | |
</head> | |
<body> | |
Serving html from restify! | |
</body> | |
</html> |
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
{ | |
"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" | |
} | |
} |
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 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