Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var app = express();
- var port = process.env.PORT || 1337;
- app.use('/i', express.static(__dirname + '/i'));
- app.use('/Stylesheets', express.static(__dirname + '/Stylesheets'));
- app.use(express.static(__dirname));
- app.listen(port);
- console.log('listening on port ' + port);
- var data = {"name":"John"};
- var result = templateEngine.bind("/template.html", data)
- $('.person').html(result);
- <div class="person">
- My Name is FirstName
- </div>
- app.**[HTTP VERB]**(**[URL]**, function(req, res){
- res.end('<html>hello world</html>');
- });
- app.get('/', function(req, res){
- res.end('<html>hello world</html>');
- });
- app.get('/test', function(req, res){
- res.end('<html>hello world from the test folder</html>');
- });
- app.post('/test', function(req, res){
- res.end('<html>Thanks for submitting your info</html>');
- });
- app.get('/test', routes.NameOfFunctionToHandleGetForSlashTest);
- app.post('/test', routes.NameOfFunctionToHandlePostForSlashTest);
Add Comment
Please, Sign In to add comment