const express = require("express");
const fs = require("fs-extra");
const sacjson = require('./sac.json');
const { createProxyMiddleware } = require('http-proxy-middleware');

const app = express()
const port = 8090
app.use(express.static('public'))
app.use(`/${sacjson.base}/${sacjson.path}/sac.json`, express.static('sac.json'))
// app.use(`/api-idata`, createProxyMiddleware({
//   target: 'http://172.27.21.88:9999/',
//   secure: false,
//   changeOrigin: true,
//   pathRewrite: { '^/api-idata': '' }
// }))
app.listen(port, () => {
  console.log(`-Local: http://localhost:${port}`)
})
