An error occurred while loading the file. Please try again.
layer.js 433 bytes
const config = require('../config');
const fs = require('fs');
const handle = (req, res) => {
  let resourse = `${config.BASE_DIR}/scenelayers/${req.params.layer}/layers/0/${config.FOLDER_INDEX.SCENELAYER}`;
  if (!fs.existsSync(resourse)) throw new Error("not found");
  res.set({
    'Content-Type': 'application/json',
    'Content-Encoding': 'gzip'
  });
  res.sendFile(resourse);
};
module.exports = handle;