Skip to content

Commit

Permalink
Last min fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jamdelion committed Apr 29, 2021
1 parent e847f58 commit 2da645a
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 17 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# week6-app-jcnr


### To run this locally:

- `git clone` the repo
- `npm install` to install the necessary node packages.
- Create a `.env` file in the root folder and add API_KEY, DATABASE_URL and COOKIE_SECRET
- `npm run dev` to run the server
- visit `localhost:3000`


Draft schema:

![image](https://user-images.githubusercontent.com/31373245/116393757-f3087a80-a819-11eb-8cbc-53a3bc17401a.png)
Binary file added public/default-skate-bkground.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion public/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ body {
img {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
position: absolute;
z-index: -1;
Expand Down
33 changes: 18 additions & 15 deletions routes/signUp.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const auth = require("../auth.js");
//NEED TO CONFIRM FROM C&R's CODE:
// const templates = require("");
const templates = require("../templates.js");

// function get(request, response) {
// const signUpForm = `
Expand All @@ -20,19 +19,23 @@ const auth = require("../auth.js");
// }

function get(request, response) {
response.send(`
<h1>Create an account</h1>
<form action="sign-up" method="POST">
<label for="username">Name</label>
<input type="text" id="username" name="username">
<label for="email">Email</label>
<input type="email" id="email" name="email">
<label for="password">Password</label>
<input type="password" id="password" name="password">
<button type="submit">Sign up</button>
</form>
`);
}
const createAccount = `
<h1>Create an account</h1>
<form action="sign-up" method="POST">
<label for="username">Name</label>
<input type="text" id="username" name="username">
<label for="email">Email</label>
<input type="email" id="email" name="email">
<label for="password">Password</label>
<input type="password" id="password" name="password">
<button type="submit">Sign up</button>
</form>
`

const html = templates.htmlTemplate(createAccount, "");
response.send(html);
;
}

function post(request, response) {
//console.log(request.body);
Expand Down
2 changes: 1 addition & 1 deletion templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function htmlTemplate(bodyContent, headerContent) {
<title>Grinder</title>
</head>
<body>
<img class='bg-image' src="" alt='random image'>
<img class='bg-image' src="/default-skate-bkground.jpg" alt='random image'>
<img class="logo" src="/Grinder-logo.png" alt="Grinder logo"><br/>
<header>
Expand Down

0 comments on commit 2da645a

Please sign in to comment.