Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- const http = require('http');
- const fs = require('fs');
- const server = http.createServer(function (request, response) {
- console.log(request.method, request.url);
- if (request.url == '/style.css'){
- const css = fs.readFileSync('style.css', 'utf8');
- response.end(css);
- }else{
- const html = fs.readFileSync('index.html', 'utf8');
- response.end(html);
- }
- });
- console.log('port = ', process.env.PORT);
- server.listen(process.env.PORT || 3000);
- console.log('Server Started, yay!');
- {
- "name": "Enigma",
- "version": "1.0.0",
- "description": "",
- "main": "server.js",
- "scripts": {
- "start": "node server.js"
- },
- "keywords": [],
- "author": "",
- "license": "ISC"
- }
- -----> Node.js app detected
- -----> Creating runtime environment
- NPM_CONFIG_LOGLEVEL=error
- NPM_CONFIG_PRODUCTION=true
- NODE_VERBOSE=false
- NODE_ENV=production
- NODE_MODULES_CACHE=true
- -----> Installing binaries
- engines.node (package.json): unspecified
- engines.npm (package.json): unspecified (use default)
- Resolving node version 6.x...
- Downloading and installing node 6.11.4...
- Using default npm version: 3.10.10
- -----> Restoring cache
- Loading 2 from cacheDirectories (default):
- - node_modules
- - bower_components (not cached - skipping)
- -----> Building dependencies
- Installing node modules (package.json)
- -----> Caching build
- Clearing previous node cache
- Saving 2 cacheDirectories (default):
- - node_modules
- - bower_components (nothing to cache)
- -----> Build succeeded!
- -----> Discovering process types
- Procfile declares types -> (none)
- Default types for buildpack -> web
- -----> Compressing...
- Done: 15M
- -----> Launching...
- Released v11
- https://enigma-test.herokuapp.com/ deployed to Heroku
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement