Norway's separation from Denmark was enforced by the Treaty of Kiel in 1814 after Napoleon's defeat. It was then ceded to Sweden, much to Norwegians' disgust at the time. Technically independent it was however ruled in practice by Sweden, the local government having little or no autonomy when it came to legislation.
I think you might have been thinking about its subsequent break with Sweden in June 1905. This is really when Norwegians reckon their independence came about, though the national day still celebrates the draft constitution drawn up in 1814 in anticipation of full independence that didn't happen.
The months around June 1905 were fraught, and there was even a half-hearted "invasion" by some Swedish troops that lasted a day or two. Some of the small border gains/losses thrashed out afterwards still rankle a bit on both sides. But as revolutions go this was really one of the velvet ones.