shiny web deployment

I was able to complete my first shiny application but I am not able deploy it on the web.This is the message I am getting:
Application successfully deployed to https://yaacov1.shinyapps.io/mortgage_calculator/
Error in func(fname, ...) : app.R did not return a shiny.appobj object. Can somebody please help? The deployment code is at the end
Code is here:

library(shiny)
library(rsconnect)

Define UI ----

ui <- fluidPage(
titlePanel("Basic widgets"),

 fluidRow(

     # column(3,
     #       h3("Buttons"),
     #        actionButton("action", "Action"),
     #        br(),
     #        br(),
     #        submitButton("Submit")),

     # column(3,
     #        h3("Single checkbox"),
     #        checkboxInput("checkbox", "Choice A", value = TRUE)),

     
     column(3,selectInput("Fixed", "Fixed:",
                 c("30 year" = "30",
                   "15 year" = "15",
                   "10  year" = "10")),
     tableOutput("data")),
     
     
     
    
     # column(3,
     #       dateInput("date",
     #                 h3("Date input"),
     #                  value = "2014-01-01"))
 ),

fluidRow(
    
    # column(3,
    #        dateRangeInput("dates", h3("Date range"))),
    # 
    # column(3,
    #        fileInput("file", h3("File input"))),
    
    
    
    column(3, 
           numericInput("housePrice", 
                        h3("Housing Price"), 
                        value = 100000)),   

    
    column(3, 
           numericInput("percentageDown", 
                        h3("Percentage Down"), 
                        value = 0.2),min=0,max=1) ,  
    
    column(3, numericInput("mortgageYield", h3("Mortgage Yield"), value=0.05, min = 0, max = 0.1, step = NA,
                          width = NULL)),
    ),

fluidRow(
    column(3, h3("Mortgage Payment"), verbatimTextOutput("mortgagepayment"))),
 
mainPanel(tableOutput("mytable"),
#DT::dataTableOutput("AmortizationTable")
plotOutput("paymentchart"))

)

Define server logic ----

server <- function(input, output) {
output$mortgagepayment <- renderText({
# prevent this block from trying to calculate when other fields are
# empty or invalid
req(input$housePrice, input$percentageDown, input$mortgageYield, input$Fixed)
# message("calculate!") # just advises when this block fires
housePrice = input$housePrice
downPayment = input$percentageDown
mortgageYield = input$mortgageYield/12
mortgageAmount = housePrice*(1-downPayment)
years = as.numeric(input$Fixed)
mortgagePayment = (mortgageAmountmortgageYield)/(1-1/(1+mortgageYield)^(12years))
})
# now calculate the amortization table (Principal + interest at each stage )
output$mytable <- renderTable({
# prevent this block from trying to calculate when other fields are
# empty or invalid
req(input$housePrice, input$percentageDown, input$mortgageYield, input$Fixed)
# message("calculate!") # just advises when this block fires
years = as.numeric(input$Fixed)
housePrice = input$housePrice
downPayment = input$percentageDown
mortgageYield = input$mortgageYield/12
mortgageAmount = housePrice*(1-downPayment)
mortgagePayment = (mortgageAmountmortgageYield)/(1-1/(1+mortgageYield)^(12years))
years = as.numeric(input$Fixed)
numofPayments =seq(1:(years12))
principalOutStanding = (1+mortgageYield)^(numofPayments-1)
t= (1+mortgageYield)^(numofPayments-1)
t=(t-1)/(1-1/(1+mortgageYield)^(12
years))
principalOutStanding = mortgageAmount * (principalOutStanding - t )
interestpaid = principalOutStandingmortgageYield
principalPaid = mortgagePayment - interestpaid
res<-data.frame(month=seq(1:(years
12)),payment = rep(mortgagePayment,years12),Principal_outstanding=principalOutStanding, interest_paid = interestpaid, principal_Paid = principalPaid )
})
output$paymentchart <- renderPlot({
# prevent this block from trying to calculate when other fields are
# empty or invalid
req(input$housePrice, input$percentageDown, input$mortgageYield, input$Fixed)
# message("calculate!") # just advises when this block fires
years = as.numeric(input$Fixed)
housePrice = input$housePrice
downPayment = input$percentageDown
mortgageYield = input$mortgageYield/12
mortgageAmount = housePrice
(1-downPayment)
mortgagePayment = (mortgageAmountmortgageYield)/(1-1/(1+mortgageYield)^(12years))
years = as.numeric(input$Fixed)
numofPayments =seq(1:(years12))
principalOutStanding = (1+mortgageYield)^(numofPayments-1)
t= (1+mortgageYield)^(numofPayments-1)
t=(t-1)/(1-1/(1+mortgageYield)^(12
years))
principalOutStanding = mortgageAmount * (principalOutStanding - t )
interestpaid = principalOutStandingmortgageYield
principalPaid = mortgagePayment - interestpaid
res<-data.frame(month=seq(1:(years
12)),payment = rep(mortgagePayment,years*12),Principal_outstanding=principalOutStanding, interest_paid = interestpaid, principal_Paid = principalPaid )
plot(res$month, res$interest_paid, type='l',col="red")
lines(res$month, res$principal_Paid,col="green")
})
}

Run the app ----

#shinyApp(ui = ui, server = server)
rsconnect::setAccountInfo(name='yaacov1',token='E1516640B752D8F37BB8050548A5E329',secret='9kzmCcmXcrrCljUzqWHhO0KRoGonjPxdPDlW61L8')
deployApp()

You commented out the shinyApp which is necessary to launch the app, and you've got unnecessary rsconnect statements that will try to deploy your app. This is bad and should be removed. So uncomment the first and comment out the rest and you'll be ok.

Hi,

I actually commented the shinyApp by purpose as I want my application to be deployed on the web so that other people will be able to play with it. I was following the steps from deploying shiny application on the web

to return a shiny.appobj you need shinyApp(ui = ui, server = server)
Can you point to a reference that taught you that you don't ?

https://www.shinyapps.io/?_ga=2.179386977.411912083.1590963496-1751348280.1590963496

if I understand it correctly in the explanation how do I connect to their server.

Sorry, I tried to follow your link but it failed for some reason...

anyway I found an article it explains how shiny has evolved over time, https://shiny.rstudio.com/articles/app-formats.html see the part about shinyApp()