For an example using the port number, see step 3 and 5 of “Getting temperature, humidity and battery level” in Getting Badgerboard to work with TTN .
For LMiC, the port number is the first parameter in:
LMIC_setTxData2(1, buffer, sizeof(buffer), 0);
In the TTN Arduino library, it’s the last parameter in:
ttn.sendBytes(buffer, sizeof(buffer), 1);
A bit more details in Is there any documentation on payload functions?
And, of course, one can also define multiple applications for different payloads.