Whispering gallery modes of a microdisk resonator are useful for the optical detection of single rubidium and cesium atoms near the surface of a substrate. Light is coupled into two high-Q whispering-gallery modes of the disk which can provide attractive and/or repulsive potentials, respectively, via their evanescent fields. The sum potential, including van der Waals/Casimir-Polder surface forces, may be tuned to exhibit a minimum at distances on the order of 100 nm from the disk surface. Simultaneously optically trapping and detecting is possible, with the back-action of an atom held in this trap on the light fields being suffciently strong to provide a measurable effect. Atom trapping and detection depend on a variety of system parameters and experimental realizations differ for different atoms.