diff --git a/index.js b/index.js index 47bf289..6c6f5b9 100644 --- a/index.js +++ b/index.js @@ -5,8 +5,7 @@ const app = express(); app.use('/ico', express.static(path.resolve(__dirname, 'ico'))); -app.use(express.static(path.resolve(__dirname, 'nexchange'))); - +var public = path.join(__dirname, 'nexchange'); function getCur(qParam) { return qParam.toUpperCase().substr(-3); } @@ -15,7 +14,7 @@ app.get('/ico', (req, res) => { res.sendFile(path.resolve(__dirname, 'ico', 'index.html')); }); -app.get('*', (req, res) => { +app.get('/', (req, res) => { let redirectRequired = false; let params = {}; if (req.query.cur_from && req.query.cur_to) { @@ -41,6 +40,8 @@ app.get('*', (req, res) => { }); -app.listen(3000, () => console.log('Example app listening on port 3000!')); - +app.use(express.static(path.resolve(__dirname, 'nexchange'))); +// remove below after solving /prices/undefined.png error +app.use('*', express.static(public)); +app.listen(3000, () => console.log('Example app listening on port 3000!'));