Nanoporous metal as a platform for electrochemical and optical sensing