Skip to content

Commit

Permalink
basic setup: linter, hapi server, index.html, main.css
Browse files Browse the repository at this point in the history
  • Loading branch information
bradreeder committed Aug 7, 2016
1 parent a23da39 commit be2cd86
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "airbnb",
"env": {
"browser": true,
"node": true
},
"rules": {
"no-console": 0,
"no-param-reassign": 0
}
}
11 changes: 11 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="public/main.css">
<title></title>
</head>
<body>

</body>
</html>
36 changes: 36 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "personal-website",
"version": "1.0.0",
"description": "A homepage for my portfolio and web development blog",
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/bradreeder/Personal-Website.git"
},
"keywords": [
"Portfolio",
"Web-Development",
"Blog"
],
"author": "Bradley Reeder",
"license": "ISC",
"bugs": {
"url": "https://github.com/bradreeder/Personal-Website/issues"
},
"homepage": "https://github.com/bradreeder/Personal-Website#readme",
"devDependencies": {
"eslint": "^3.2.2",
"eslint-config-airbnb": "^10.0.0",
"eslint-config-defaults": "^9.0.0",
"eslint-plugin-import": "^1.12.0",
"eslint-plugin-jsx-a11y": "^2.0.1",
"eslint-plugin-react": "^6.0.0"
},
"dependencies": {
"hapi": "^14.1.0",
"inert": "^4.0.1"
}
}
3 changes: 3 additions & 0 deletions public/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
body {
background-image: url('/resources/background_image.jpg');
}
Binary file added resources/background_image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions server/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
const hapi = require('hapi');

const server = new hapi.Server();
server.connection({
port: 4000,
host: 'localhost',
});
server.register(require('inert'), (err) => {
if (err) throw err;
server.route([{
path: '/',
method: 'GET',
handler: (request, response) => {
response.file('./index.html');
},
}, {
path: '/public/{file*}',
method: 'GET',
handler: {
directory: {
path: './public',
listing: true,
},
},
}, {
path: '/resources/{file*}',
method: 'GET',
handler: {
directory: {
path: './resources',
listing: true,
},
},
}]);
});

server.start(() => {
console.log(`Server is currently running on: ${server.info.uri}`);
});

0 comments on commit be2cd86

Please sign in to comment.