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

225
Views
No se puede cargar "style.css" en el archivo pug usando nodejs

Soy nuevo en nodejs y estoy usando el marco "expressjs", y estoy tratando de mostrar una página estática simple usando la extensión "pug" pero el archivo "css" no se está cargando/funcionando Aquí está la estructura de mi archivo

 demo(Main Project/root) index(Main file) views public views dashboard style.css

Y aquí está el código index.js

 var express = require('express') var app = express() //app.use("/styles", express.static(__dirname + '/styles')); var path = require('path'); app.set('views', path.join(__dirname, './views')); app.set('view engine', 'pug'); app.use(express.static(path.join(__dirname, 'public'))); app.get('/first_template', function(req, res){ res.render('index'); }); app.listen(3000)

Aquí está mi código index.pug

 html head title Dashboard link(rel='stylesheet', href='/views/dashboard/style.css') body p Hi!

¿Cómo puedo agregar "style.css" a index.pug? ¿Dónde estoy equivocado?

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!