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

396
Views
My script doesn't work / is not visibility etc

I have a problem with inject script in html file. I inserted into body my primary script and it does not work. I don't have idea how to fix that, and I don't have idea how to find a respone on google... Just help me please. Thanks :)

Files structure:

_node_modules

_src:
____app.js
____style.css

add.html
index.html
package-lock.json
package.json
server.js

index.html

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Doc</title>
  
</head>
<body>
  <script src="./src/app.js"></script>
</body>
</html>

app.js

alert("test")

server.js

const PORT = "3030";
const express = require('express')
const mysql = require('mysql')
const app = express()

app.use(express.static('src'))

const con = mysql.createConnection({
    host: "localhost",
    user: "root",
    password: "",
    database: "expenseapp"
})
con.connect(err=>{
    if(err)
        throw err;
    console.log('connected!');
    
})

app.get('/',(req,resp)=>{
    let array = []
    let queryName = "SELECT * from `expenses`";
    con.query(queryName, (err,res)=>{
        if(err){
            console.log(err);
            res.sendStatus(500);
            return;
        }
        res.forEach(element => {
            array.push(element)
        });
        resp.json(array)
    })
})
app.listen(PORT, ()=>console.log(`Server's running on PORT ${PORT}`))
about 4 years ago · Juan Pablo Isaza
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!