Подключения собственного модуля к html (node express mongo)

Есть такая структура:

  • models -> model.js
  • node_modules
  • views -> index.html
  • index.js

model.js:

const mongoose = require('mongoose');
const Schema = mongoose.Schema;

const SportAreaSchema = new Schema({
   id_object: String,
   object: String,
})

const SportAreas = mongoose.model('SportAreas', SportAreaSchema)

module.exports = SportAreas

в index.js он подключется и работает без проблем.

const model = require('./model')

Как можно подключить его к index.html ?

По сути я хочу использовать массив данный который приходит на html в самом JS коде, а не просто вывод на страницу. Спасибо.


Ответы (0 шт):