I created a server with the express package, and I'm trying to read in a specific way the parameters from the URL. The URL goes like this: http://127.0.0.1:8080/screen=3 (no '?' as the sign for parameters). I need to save the number of the screen in a variable.
I tried this:
var express = require('express');
var app = express();
app.get('/screen:sceenNum', function (req, res) {
var temp = req.sceenNum;
res.send(temp); //for checking on the browser
});
I also tried this, but he must get '?' in the URL:
app.get('/', function(req, res) {
var screenNum = req.param('screen');
res.send(screenNum);
});
Can anyone please have a solution? Thank you