On-chip integration of optical detection units into the microfluidic systems for online monitoring is highly desirable for many applications and is also well in line with the spirit of optofluidics technology–fusion of optics and microfluidics for advanced functionalities. This paper reports the construction of a UV-Vis spectrophotometer on a microreactor, and demonstrates the online monitoring of the photocatalytic degradations of methylene blue and methyl orange under different flow rates and different pH values by detecting the intensity change and/or the peak shift. The integrated device consists of a TiO2-coated glass substrate, a PDMS micro-sized reaction chamber and two flow cells. By comparing with the results of commercial equipment, we have found that the measuring range and the sensitivity are acceptable, especially when the transmittance is in the range of 0.01–0.9. This integrated optofluidic device can significantly cut down the test time and the sample volume, and would provide a versatile platform for real-time characterization of photochemical performance. Moreover, its online monitoring capability may enable to access the usually hidden information in biochemical reactions like intermediate products, time-dependent processes and reaction kinetics.