Skip to content

Instantly share code, notes, and snippets.

@barrycumbie
Last active September 5, 2023 17:33

486πŸš€

Dev Lab November Node<-(data)->ejs & PRs too

User Story (:t-shirt: small or medium small)

As a ___ ??

I want ____ pass data client to server

So that ____ front and back end are connected

==

As a ___ me

I want ____ all our MIKEs in one place

So that ____ i can find em easy

Narrative

@peytonjunjulas
Copy link

peytonjunjulas commented Aug 30, 2022 β€’

Name: Peyton Junjulas
Year: Graduating Senior
GH profile: https://github.com/peytonjunjulas
dev-lab-mike: https://github.com/peytonjunjulas/dev-lab-mike

@Koby1K
Copy link

Koby1K commented Aug 30, 2022

@ColinTate24
Copy link

@Kiikz
Copy link

Kiikz commented Aug 30, 2022

@jacobsanders7
Copy link

@astricklandd
Copy link

@NashJ99
Copy link

NashJ99 commented Aug 30, 2022

@gavinraney
Copy link

gavinraney commented Aug 30, 2022 β€’

@hunter-mcgriff
Copy link

@tgwisdom
Copy link

@AdamWarren01
Copy link

Name: Adam Warren

GitHub REPO: https://github.com/AdamWarren01/dev-lab-november

@FlameRender
Copy link

@barrycumbie
Copy link
Author

spin up v2.0

new node + express hosted GitHub & delpyed with Heroku, dev w/vsCode.

  • from scratch
  • init a new GH repo on g/h
    • new repo
    • use their suggested name
    • options: choose: add readme, public, gitignore template = node, licence = gpl 3.0
    • click big green
  • copy from big green code button my https path to .git file
  • over to vsCode on my devbox
  • open up terminal, use gitbash
  • $: ls # to see where I'm at
  • $: do more cli cmds like cd desktop to get to where you wanna dev
  • cd into your working directory
  • tip: in cli, hit tab often to predict filename
  • tip: PS1='$: ' #rename your prompt

@barrycumbie
Copy link
Author

from ☝️

  • cli: 'code .'
  • check versions...npm -v node v , if not, go install node from πŸ¦† nodejs
  • npm init -y => creates package.json
  • install pkg: express: npm i express --save
  • touch app.js
  • open app.js click onit.
  • πŸ¦† nmpjs xpress grab starter code
const express = require('express')
const app = express()

app.get('/', function (req, res) {
  res.send('Hello World')
})

app.listen(3000)

@barrycumbie
Copy link
Author

barrycumbie commented Aug 30, 2022 β€’

from above ☝️

  • test local: 'node app.js` (allow firewall access if that is a thing πŸ”₯ 🧱 )
  • go to http://localhost:3000
  • if works, 😎
  • either kill server with a ctrl + c or open new bash terminal
  • do our git salute
git status #show me what has changed
git add [filename] [filename] [filename]
gist commit -m 'some super awesome consice meanignful misspelled msg'
git push

@barrycumbie
Copy link
Author

troubleshooting to github on your push

:duck personal access token on git
try storing your credential on git global: https://docs.github.com/en/get-started/getting-started-with-git/setting-your-username-in-git

  • head over yonder to heroku.com, createa new app
  • options: name it whatever you like, click big purple
  • deploy metnhod: github, search for my repo
  • enable auto deploy
  • first time only, manual deply
  • when ready, click view app: https://studious-robot.herokuapp.com/
  • head back to vsCode and get this thing heroku ready
  • on app.js,
- app.listen(3000)
+ app.listen(process.env.PORT || 3000,
    () => console.log("Server is running..."));

@barrycumbie
Copy link
Author

from ☝️

  • wait a πŸ”₯ second for heroku to cycle...then check out your deployed app

@barrycumbie
Copy link
Author

let the machine do the work

@Kiikz
Copy link

Kiikz commented Sep 6, 2022 β€’

  • npm i ejs
  • npm i body-parser
    Check package version πŸ‘‰ npm list body-parser

@barrycumbie
Copy link
Author

barrycumbie commented Sep 6, 2022 β€’

Generate a P/R on G/H

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment