Jean-alien / solid-fishstick-snowcats

Jean's CIS 486 Repository | https://icecold-polar-render.onrender.com/
https://github.com/man2055/solid-fishstick-snowcats
GNU General Public License v3.0
0 stars 0 forks source link

git my localhost on the web (PaaS) #4

Open Jean-alien opened 7 months ago

Jean-alien commented 7 months ago

identify a PasS ==> render.com

Jean-alien commented 7 months ago

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 commented 7 months ago

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 commented 7 months ago

※ The log says my web server is alive.

image

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

web server successfully set up

Jean-alien commented 7 months ago

※ 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 commented 7 months ago

change settings --> switch branch to iss4.

image

Jean-alien commented 7 months ago

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

create branch issue4 and upload code (git push)