It was frequently used as the seat of the king , and was the capital of Norway until 1217 .
It was frequently used as the seat of the king , and was capital of Norway until 1217 .