Answer the question
In order to leave comments, you need to log in
JS-crypt gives html instead of js-code inside it based on express.js. What is the problem?
Good afternoon!
Ask for help from the community.
I am creating a simple express.js server:
const express = require('express');
const app = express();
app.get("*", (req, res) => {res.sendFile(__dirname + '/index.html');});
app.listen(8080, () => {console.log("Server is running!");});
I include scripts in the Index.html file: one script from the script.js file, the other just through the script tags.
The problem is that script.js doesn't work. It doesn't even connect! If you select this script in the "view page code", then not the text of the script is displayed, but again the html file.
The nested script works.
All documents are at the same nesting level (in the same folder).
Moreover, if you remove type="text/babel" when calling the script or write type="text/javascript", then a SyntaxError: Unexpected token < error is generated, pointing to the DOCTYPE directive.
I don't understand what's the matter. Hope someone can help :)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question