Pouchdb 简明教程
PouchDB - Environment
本章说明如何在系统中下载和安装PouchDB。
This chapter explains how to download and install PouchDB in your system.
Installing PouchDB
为了使用PouchDB,你需要下载文件 .js 并将其包含在你的脚本中。以下是安装PouchDB的步骤。
In order to work with PouchDB, you need to download the file .js file and include it in your script. Following are the steps to install PouchDB.
Step 1
通过单击以下链接访问PouchDB网站的主页 −
Visit the homepage of PouchDB website, by clicking the following link −
Installing Pouch Using Node.js
你还可以将PouchDB安装为Node.js模块。以下是使用Node.js安装PouchDB的步骤。
You can also install PouchDB as Node.js module. Following are the steps to install PouchDB using Node.js.
Step 1
按照我们 coffee script 教程的安装Node.js部分中提供的步骤安装Node.js。
Install Node.js by following the steps given in the Installing Node.js section of our coffee script tutorial.
Downloading CouchDB
当离线时,PouchDB将数据存储在本地,并像应用程序一样工作。你可以通过连接到兼容的服务器在线访问它。众所周知,PouchDB可以连接到CouchDB,所以,我们也安装CouchDB。以下是安装CouchDB的步骤。
When offline, PouchDB stores data locally and works like an app. You can access it online by connecting with compatible servers. As we know PouchDB can be connected to CouchDB, so, lets install CouchDB too. Following are the steps to install CouchDB.
Step 1
CouchDB的官方网站为 http://couchdb.apache.org 。如果你单击给定的链接,你可以获得CouchDB官方网站的主页,如下面的截图所示。
The official website for CouchDB is http://couchdb.apache.org. If you click the given link, you can get the home page of CouchDB official website as shown in the following screenshot.
Installing CouchDB
一个Windows可执行 setup-couchdb-1.6.1_R16B02.exe 文件将下载到你的系统中。运行安装文件并继续安装。
A windows executable setup-couchdb-1.6.1_R16B02.exe file will be downloaded on your system. Run the setup file and proceed with the installation.
在成功安装CouchDB到你的系统后,打开安装CouchDB的文件夹,转到bin文件夹,并通过运行名为 couchdb.bat 的脚本文件来启动服务器。
After installing CouchDB in your system successfully, open the folder where CouchDB was installed, go to the bin folder, and start the server by running a script file named couchdb.bat.
安装完成后,访问以下链接打开 CouchDB 的内置 Web 界面: http://127.0.0.1:5984/ 。如果一切顺利,您将获得一个 Web 页面,其中包含以下输出。
After installation, open built-in web interface of CouchDB by visiting the following link − http://127.0.0.1:5984/. If everything goes fine, this will give you a web page, which will have the following output.
{
"couchdb":"Welcome","uuid":"c8d48ac61bb497f4692b346e0f400d60",
"version":"1. 6.1",
"vendor": {
"version":"1.6.1","name":"The Apache Software Foundation"
}
}
您可以使用以下 URL 与 CouchDB Web 界面交互:
You can interact with CouchDB web interface by using the following URL −
http://127.0.0.1:5984/_utils/
这会向您展示 Futon 的索引页面,它是 CouchDB 的 Web 界面。
This shows you the index page of Futon, which is the web interface of CouchDB.