Jean-alien/solid-fishstick-snowcats

git my localhost on the web (PaaS)

Opened this issue · 6 comments

identify a PasS ==> render.com

sign into Render w/github credential

start new Web Service

connect to GitHub Repo

give it a unique name (unique on web, not unique to just your acc't like github) mine: icecold-polar-render

pick what branch to deploy from. I chose iss3.

Web Server Settings:

Runtime = Node

Build Command = npm

Start Command = node app.js

"Create Web Service" big purple button --> create web

Refactor with port binding

link url: https://docs.render.com/web-services

const express = require('express')
const app = express()
const port = process.env.PORT || 5500;

app.get('/', (req, res) => {
  res.send('Hello World from Express')
})

app.listen(port, () => {
  console.log(`Example app listening on port ${port}`)
})

※ The log says my web server is alive.

image

※ my web server icecold-polar-render runs successfully.

web server successfully set up

  • $ git checkout -b iss4 ==> create a new branch iss4

  • $ node app.js ==> execute javaScript

※ receive a response:

'mike app listening on port 5500'
verifies server listens to request on port 5500 by displaying message on the console

※ my localhost connected successfully.
localhost 5500 connected

change settings --> switch branch to iss4.

image

  • $ git add app.js ==> save changes of file

  • $ git commit -m 'added port binding' ==> leave a quote about the feature

  • $ git push --set-upstream origin iss4 ==> upoad to the repository in branch

※ branch issue 4 created on my GitHub repository and code uploaded on my repository.

create branch issue4 and upload code (git push)