https://github.com/stack-stark/ionic-movie
https://github.com/stack-stark/ionic-movie
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/stack-stark/ionic-movie
- Owner: stack-stark
- License: mit
- Created: 2019-04-18T06:13:18.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-02-02T14:41:29.000Z (about 3 years ago)
- Last Synced: 2025-01-29T04:19:12.280Z (about 1 year ago)
- Language: TypeScript
- Size: 2.84 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## 豆瓣电影的ionic版
`应项目需要,故此写个ionic版的豆瓣电影练练手`
### 搭建工程
`0.安装ionic,cordova`
``` shell
npm install -g cordova ionic
```
`1.初始化工程`
``` shell
ionic start ionic-movie tabs
```
### 豆瓣电影api
- base `https://api.douban.com/v2`
- 搜索 `/movie/search?q=${query}&start=${start}&count=${count}`
- 详情 `/movie/subject/${id}`
- 热映 `/movie/in_theaters?start=${start}&count=${count}$city=${city}`
- 推荐 `/movie/top250?start=${start}&count=${count}`
### 跨域解决
`0.新建proxy.config.json`
``` json
{
"/movie": {
"target": "https://api.douban.com/v2",
"secure": false,
"logLevel": "debug",
"changeOrigin": true
}
}
```
`1.angular.json中的serve.options,添加"proxyConfig": "proxy.config.json"`
``` json
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "app:build",
"proxyConfig": "proxy.config.json"
}
}
```