Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git my localhost on the web (PaaS) #4

Open
Jean-alien opened this issue Jan 22, 2024 · 6 comments
Open

git my localhost on the web (PaaS) #4

Jean-alien opened this issue Jan 22, 2024 · 6 comments

Comments

@Jean-alien
Copy link
Owner

identify a PasS ==> render.com

@Jean-alien
Copy link
Owner Author

Jean-alien commented Jan 23, 2024

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

@Jean-alien
Copy link
Owner Author

Jean-alien commented Jan 23, 2024

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}`)
})

@Jean-alien
Copy link
Owner Author

Jean-alien commented Jan 23, 2024

※ The log says my web server is alive.

image

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

web server successfully set up

@Jean-alien
Copy link
Owner Author

Jean-alien commented Jan 23, 2024

  • $ 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

@Jean-alien
Copy link
Owner Author

change settings --> switch branch to iss4.

image

@Jean-alien
Copy link
Owner Author

Jean-alien commented Jan 23, 2024

  • $ 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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant