It wasn't really a surprise. By August of 1974, all of the revelations about Watergate, Nixon's personal involvement in numerous illegal and unethical actions, and the House of Representatives and Senate's moves towards impeaching Nixon had basically reached a fever pitch. In the days and weeks before his resignation, Nixon had been facing calls to resign from all but his absolute closest, most dedicated allies. Most members of congress, almost every major newspaper, and a whole host of other people had already called for his resignation. So it never really could have come as a complete shock that he would chose to step down rather than be impeached.
There were also clear signs in the day or two before his resignation that it was coming. On the day that Nixon resigned the Washington Post printed a story indicating that the President was "reported yesterday [August 7th] to be nearing a decision to resign." The same day, Nixon met with Senate Minority leader Hugh Scott and House Minority leader John Rhodes, as well as Senator Barry Goldwater (basically, the republican congressional leadership). They reportedly told him that he had almost no support in Congress (remember, Congress was expecting to hold a vote to impeach the President shortly). They basically told him that no more than 10-15 senators or congressmen were going to vote against impeachment.
The next morning (ie, the day Nixon resigned) Nixon's deputy press secretary Gerald Warren spoke to the press corp and announced that "The President asked the Vice President to come over this morning for a private meeting - and this is all the information I have at the moment."
According to the New York Times:
Warren's manner and the news he had to impart made it clear at last that resignation was a certainty. Reports already were circulating on Capitol Hill that the President would hold a reception for friends and staff members late in the day and a meeting with congressional leaders.
A few hours later, Nixon's press secretary Ronald Ziegler held a second press conference to announce that the President would hold a press conference on live TV that night. Ziegler was obviously emotional at that conference (he had spent over a decade working with Nixon), and he said that:
I am aware of the intense interest of the American people and of you in this room concerning developments today and over the course of the last few days. This has, of course, been a difficult time.
To give you an idea of how much speculation there was that Nixon was about to resign, when Ziegler said "the president" would address the nation at 9pm that night, the press corp had to ask (and Ziegler had to confirm) that by "The President" he still meant Nixon and not Ford. That afternoon, House Minority Leader John J. Rhodes basically leaked/confirmed the news, predicting that Nixon would resign.
So even though the public might not have definitely heard that the president was about to resign (I'm not sure if it was reported on the radio or TV or not - but definitely the newspapers had not had a chance to report this), the press corps was definitely expecting Nixon to step down - and the anticipation/expectations of the reporters covering the story was pretty obvious.
So the tl/dr is basically that no, it was not a surprise at all. Partly because Nixon was basically out of options and facing calls to resign from left, right, and center at that point, and partly because there were plenty of signs that it was coming. For most people, the reaction was one of "thank god that's over" rather than one of shock.