ExpressJS Pass variables to JavaScript

后端 未结 5 1357
谎友^
谎友^ 2021-02-07 12:35

I am completely lost on this; I am using NodeJS to fetch a JSON and I need to pass the variable to my page and have JavaScript use the data.

app.get(\'/test\', f         


        
5条回答
  •  爱一瞬间的悲伤
    2021-02-07 13:27

    You could leverage Now.js for this. It easily allows you to share variables client/server side real-time.

    Check it out: http://www.nowjs.com/

提交回复
热议问题