Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have installed bootstrap with NPM and got the css to work fine with the following syntax:

//server side 
const path = require('path');
expressApp.use(express.static(path.join(__dirname, '/node_modules/bootstrap/dist/css')));

//client side 
<link rel="stylesheet" type="text/css" href="bootstrap.css">

However, when I try to do the same thing for adding the js from bootstrap 4 I'm not able to success. I have tried the following way:

expressApp.use(express.static(path.join(__dirname, '/node_modules/bootstrap/dist/js')));

<script src="bootstrap.bundle.js"></script>

Can anyone help me out with this one? Thank you in advance.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
197 views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...