A
A
Artem2021-07-15 15:10:42
Express.js
Artem, 2021-07-15 15:10:42

Pass processed code to another server via node js?

Started the server via 'npm start' . Everything is output to the specified address correctly. Can you please tell me if there is a way to output data to a standard page in 'openserver' 'localhost:3000' or to get this data using some kind of request?

const express = require('express')
const app = express()
const port = 3001

app.use('/st', express.static('app'))

app.listen(port, () => {
})


In the 'app' folder in the 'html' file, a framework was created, and 'js' was also created in which:
$(document).ready(function () {
    function getRandomInt(max) {
        return Math.floor(Math.random() * max);
    }
    $('.header-wrapper').after('<div><span>' + getRandomInt(10) + '</span></div>')
})

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question