As to legal or not, check with your local laws. They change from state to state, That said, many old bike lights were nothing more than a mounted flashlight.
Flashlights are cheap, and there's the rub. Mounting is almost always a very mixed affair, heavy, and the patterns less than ideal. There...