Skip to content

Instantly share code, notes, and snippets.

View mckiersey's full-sized avatar

Sean McKiernan mckiersey

View GitHub Profile
@mckiersey
mckiersey / homepage.html
Last active March 21, 2021 14:09
web dev tutorial- homepage
<!DOCTYPE html>
<html>
<head>
<title>Web dev for absolute beginners</title>
</head>
<body>
<h1>Full stack front end dev</h1>
<p>First step towards your website- nice one!</p>
</body>
</html>
@mckiersey
mckiersey / server.js
Last active January 7, 2021 17:50
Code to start the server
const server = app.listen(port, (error) => {
if(error) return console.log(`** SERVER ERROR: ${error}`);
console.log(`Server is running on port: ${server.address().port}`)
});
@mckiersey
mckiersey / server.js
Created January 7, 2021 17:50
Define some variables to get started
// We need to create a bunch of variables to set up the server
// const is (one of the ways) to create variables in javascript
const express = require('express');
const app = express();
const port = 80;
const path = require('path');
@mckiersey
mckiersey / routes.js
Last active January 7, 2021 19:35
Start of routes file, which routes various API requests
// DEFINE APP
const router = app => {
app.get('/', (request, response)=> {
response.send("So this message is coming from your app, which is also known as your server!");
});
@mckiersey
mckiersey / server.js
Created January 7, 2021 19:15
Server with routes
const express = require('express');
const app = express();
const port = 80;
const path = require('path');
const routes = require('./routes.js');
//start the server
const server = app.listen(port, (error) => {
@mckiersey
mckiersey / routes_with_html.js
Created January 7, 2021 19:59
routes file now with html
// DEFINE APP
const router = app => {
app.get('/', (request, response)=> {
response.send("So this message is coming from your app, which is also known as your server!");
});
app.get('/home', (request, response)=>{
response.sendFile("/Users/Seansmac/Desktop/Dev/Full_stack_for_absolute_beginners/myrepo/FullStackDev/homepage.html")
<!DOCTYPE html>
<html>
<head>
<title>Web dev for absolute beginners</title>
</head>
<body>
<h1>Full stack front end dev</h1>
<p1>First step towards your website- nice one!</p1>
<h2>Adding content to our website</h2>
<!DOCTYPE html>
<html>
<head>
<title>Web dev for absolute beginners</title>
<script src="https://apis.google.com/js/platform.js" async defer></script>
<meta name="google-signin-client_id" content="111444900791603213415.apps.googleusercontent.com">
</head>
<body>
<h1>Full stack front end dev</h1>
<!DOCTYPE html>
<html>
<head>
<title>Web dev for absolute beginners</title>
<script src="https://apis.google.com/js/platform.js" async defer></script>
<meta name="google-signin-client_id" content="170958026096-1delfs3g8tg4hoeg6bgs5ickhpe7k5pt.apps.googleusercontent.com">
</head>
<body>
<h1>Full stack front end dev</h1>
<!DOCTYPE html>
<html>
<head>
<title>Web dev for absolute beginners</title>
<script src="https://apis.google.com/js/platform.js" async defer></script>
<meta name="google-signin-client_id" content="170958026096-1delfs3g8tg4hoeg6bgs5ickhpe7k5pt.apps.googleusercontent.com">
</head>
<body>
<h1>Full stack front end dev</h1>