Please I am working on a project that takes the req.query part of a url and checks if its a correct fraction or not i.e.
1/2 // This is a valid fraction 1//2 // This is an Invalid fraction
The problem is when it receives a URL like this https://rough-volcano-starburst.glitch.me/api/convert?input=1//2gal
app.route('/api/convert')
.get(function (req, res){
let input = req.query.input;
}
The input variable shows '1/2gal'
It doesn't matter how many slashes I put, I still get 1/2gal.
Please help.