I've had several wired just this way - The motor actually plugs into an outlet that is in the middle of a cord with a plug on one end and a foot pedal on the other. The outlet has two spots - one marked MOTOR and one marked LIGHT.
If you plug the motor directly into the wall it will take off full speed. You really don't want to do that . . .