page2.ssjs 622 B

1234567891011121314151617181920
  1. conn.write("HTTP/1.0 200 OK\r\n")
  2. conn.write("Content-Type: text/html\r\n")
  3. conn.write("\r\n")
  4. conn.write("<html><body>\r\n")
  5. conn.write("<p>This is an example of a server side JavaScript, served by the ")
  6. conn.write('<a href="https://github.com/civetweb/civetweb/">CivetWeb web server</a>.')
  7. conn.write("</p>\r\n<p>")
  8. elms = Object.getOwnPropertyNames(conn)
  9. for (var i = 0; i < elms.length; i++) {
  10. conn.write(JSON.stringify(elms[i]))
  11. conn.write(JSON.stringify(Object.getOwnPropertyDescriptor(conn, elms[i])))
  12. conn.write("<br>\r\n")
  13. }
  14. conn.write('</p>\r\n')
  15. conn.write('</body></html>\r\n')