Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. 'use strict';
  2.  
  3. const http = require('http');
  4. const fs = require('fs');
  5.  
  6. const server = http.createServer(function (request, response) {
  7.  
  8. console.log(request.method, request.url);
  9. if (request.url == '/style.css'){
  10. const css = fs.readFileSync('style.css', 'utf8');
  11. response.end(css);
  12. }else{
  13. const html = fs.readFileSync('index.html', 'utf8');
  14. response.end(html);
  15. }
  16. });
  17. console.log('port = ', process.env.PORT);
  18.  
  19. server.listen(process.env.PORT || 3000);
  20. console.log('Server Started, yay!');
  21.  
  22. {
  23. "name": "Enigma",
  24. "version": "1.0.0",
  25. "description": "",
  26. "main": "server.js",
  27. "scripts": {
  28. "start": "node server.js"
  29. },
  30. "keywords": [],
  31. "author": "",
  32. "license": "ISC"
  33. }
  34.  
  35. -----> Node.js app detected
  36. -----> Creating runtime environment
  37.  
  38. NPM_CONFIG_LOGLEVEL=error
  39. NPM_CONFIG_PRODUCTION=true
  40. NODE_VERBOSE=false
  41. NODE_ENV=production
  42. NODE_MODULES_CACHE=true
  43. -----> Installing binaries
  44. engines.node (package.json): unspecified
  45. engines.npm (package.json): unspecified (use default)
  46.  
  47. Resolving node version 6.x...
  48. Downloading and installing node 6.11.4...
  49. Using default npm version: 3.10.10
  50. -----> Restoring cache
  51. Loading 2 from cacheDirectories (default):
  52. - node_modules
  53. - bower_components (not cached - skipping)
  54. -----> Building dependencies
  55. Installing node modules (package.json)
  56. -----> Caching build
  57. Clearing previous node cache
  58. Saving 2 cacheDirectories (default):
  59. - node_modules
  60. - bower_components (nothing to cache)
  61. -----> Build succeeded!
  62. -----> Discovering process types
  63. Procfile declares types -> (none)
  64. Default types for buildpack -> web
  65. -----> Compressing...
  66. Done: 15M
  67. -----> Launching...
  68. Released v11
  69. https://enigma-test.herokuapp.com/ deployed to Heroku
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement