Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/469.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何用HTML、CSS和postgres构建一个简单的应用程序_Javascript_Jquery_Html_Node.js_Postgresql - Fatal编程技术网

Javascript 如何用HTML、CSS和postgres构建一个简单的应用程序

Javascript 如何用HTML、CSS和postgres构建一个简单的应用程序,javascript,jquery,html,node.js,postgresql,Javascript,Jquery,Html,Node.js,Postgresql,我正在用HTML、CSS和postgreSQL构建一个简单的web应用程序。 我正在使用Node.js构建一个web后端,并尝试使用SQL数据库存储应用程序数据。表单从用户处收集评论,存储在数据库中,并以html格式显示评论。我的代码中不断出现错误 <!DOCTYPE html> <html> <head> <title>Editor</title> <link rel="stylesheet" href="styles

我正在用HTML、CSS和postgreSQL构建一个简单的web应用程序。 我正在使用Node.js构建一个web后端,并尝试使用SQL数据库存储应用程序数据。表单从用户处收集评论,存储在数据库中,并以html格式显示评论。我的代码中不断出现错误

<!DOCTYPE html>
<html>

<head>
  <title>Editor</title>
  <link rel="stylesheet" href="stylesheets/stylesheet.css">
  <link rel="shortcut icon" href="">
</head>

<body>
  <div id="commentNav" contenteditable="true">
    <h1>Comments</h1>
    <form action="/comments" method="POST">
        <input type="text" name="name" placeholder="First Name"/>
        <textarea rows="4" name="comment">Describe your favorite</textarea>
        <input type="submit" value="Submit"/>
    </form>
    <section id="suggestions">
      <h2>Comment List</h2>
    </section>
  </div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="javascripts/script.js"></script>

</body>
</html>
错误:

Failed to load resource: the server responded with a status of 404 (Not Found)

使用node postgres js模块连接到数据库必须按照以下步骤进行:

const client = new Client({
  user: 'dbuser',
  host: 'database.server.com',
  database: 'mydb',
  password: 'secretpassword',
  port: 3211,
})
client.connect()

有关更多信息,请参见使用node postgres js模块连接到数据库的操作如下:

const client = new Client({
  user: 'dbuser',
  host: 'database.server.com',
  database: 'mydb',
  password: 'secretpassword',
  port: 3211,
})
client.connect()
有关更多信息,请参阅

const client = new Client({
  user: 'dbuser',
  host: 'database.server.com',
  database: 'mydb',
  password: 'secretpassword',
  port: 3211,
})
client.connect()