Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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) {
Expand All @@ -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!'));