Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

158
Views
stuck at building process while hosting on Vercel

I'm using node.js as a server-side to store the API respond, the app is working without any issue but recently I have been trying to host it on Vercel so I ran into many issue, the project get stuck at the building process...

the building output :

Building output

My server.js code :

// Setup empty JS object to act as endpoint for all routes
projectData = {};

// Require Express to run server and routes
const express = require('express');
// Start up an instance of app
const app = express();
/* Middleware*/
//Here we are configuring express to use body-parser as middle-ware.
const bodyParser = require('body-parser');
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());

// Cors for cross origin allowance
const Cors = require('cors');
app.use(Cors());
// Initialize the main project folder
app.use(express.static('website'));


// Setup Server
const port = 8000;
const Server = app.listen(port , run);

function run() {
    console.log(`hello there :D`);
    console.log(`here is ${port} ready to go`);
}
//GET method
app.get('/all', function(req,res){
    res.send(projectData)
    console.log(projectData);
})
//POST method
app.post("/addUserComment", function(req,res){
    projectData = {
        temp : req.body.temp,
        date : req.body.date,
        feeling : req.body.feeling,
    }
    console.log(projectData);
    res.send(projectData);
})

My working directory and build settings :

Working directory

Build settings

note: server.js is my server-side file, and my website folder includes my app.js file and my HTML, CSS files, also i did try to add Vercel.json file but i couldn't understand how to use it, so if you gonna add this file in your answer please explain how and why

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I think you need to remove the build command, because it's now trying to run the server.js file instead of making a build.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!