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