-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
94 changed files
with
2,698 additions
and
14,549 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
indent_style = space | ||
end_of_line = lf | ||
insert_final_newline = true | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
TIMES=2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,27 @@ | ||
.DS_Store | ||
# dependencies | ||
node_modules | ||
|
||
# tests | ||
test/unit/coverage | ||
test/e2e/reports | ||
|
||
# others | ||
.tags | ||
.tags_swap | ||
node_modules/ | ||
dist/ | ||
npm-debug.log* | ||
|
||
# logs | ||
npm-debug.log | ||
yarn-debug.log* | ||
yarn-error.log* | ||
test/unit/coverage | ||
test/e2e/reports | ||
selenium-debug.log | ||
|
||
# Nuxt build | ||
.nuxt | ||
|
||
# Nuxt generate | ||
dist | ||
|
||
# config | ||
config.example.js | ||
|
||
# Heroku | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/build/ | ||
/config/ | ||
/dist/ | ||
/node_modules/ | ||
{{#unit}} | ||
/test/unit/coverage/ | ||
{{/unit}} | ||
html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,22 @@ | ||
# animeloop-server-vue | ||
# animeloop-web-nuxt | ||
|
||
> An animeloop server front-end project, based on vue.js | ||
> Nuxt.js project | ||
## Build Setup | ||
|
||
``` bash | ||
# install dependencies | ||
yarn install | ||
$ npm install # Or yarn install | ||
|
||
# serve with hot reload at localhost:8080 | ||
npm run dev | ||
# serve with hot reload at localhost:3000 | ||
$ npm run dev | ||
|
||
# or | ||
yarn start | ||
# build for production and launch server | ||
$ npm run build | ||
$ npm start | ||
|
||
# build for production with minification | ||
npm run build | ||
|
||
# build for production and view the bundle analyzer report | ||
npm run build --report | ||
|
||
# run unit tests | ||
npm run unit | ||
|
||
# run e2e tests | ||
npm run e2e | ||
|
||
# run all tests | ||
npm test | ||
# generate static project | ||
$ npm run generate | ||
``` | ||
|
||
For detailed explanation on how things work, checkout the [Nuxt.js docs](https://github.com/nuxt/nuxt.js). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import fetch from 'isomorphic-fetch'; | ||
import qs from 'qs'; | ||
|
||
import { apiPrefix } from '../config'; | ||
|
||
function encodeFormData(data) { | ||
return Object.entries(data).map(item => ( | ||
`${item[0]}=${encodeURIComponent(item[1])}` | ||
)).join('&'); | ||
} | ||
|
||
/* request proptype: { | ||
* url: '', | ||
* data: {}, | ||
* method: 'GET', | ||
* } | ||
*/ | ||
async function callApi(request) { | ||
const init = { | ||
method: request.method || 'GET', | ||
headers: {}, | ||
}; | ||
const hasBody = !((init.method === 'GET') || (init.method === 'HEAD')); | ||
|
||
// headers and body | ||
if (hasBody) { | ||
init.headers['content-type'] = 'application/x-www-form-urlencoded'; | ||
init.body = encodeFormData(request.data); | ||
} | ||
|
||
// url | ||
const url = ((!hasBody) && (request.data)) | ||
? `${apiPrefix}${request.url}${qs.stringify(request.data, { addQueryPrefix: true })}` | ||
: `${apiPrefix}${request.url}`; | ||
|
||
try { | ||
const res = await fetch(url, init); | ||
const json = await res.json(); | ||
console.log(url); | ||
return json; | ||
} catch (error) { | ||
throw error; | ||
} | ||
} | ||
|
||
const remote = { | ||
getOneRandomLoop: callApi({ url: 'rand/loop/full' }), | ||
getRandomLoopList: count => callApi({ url: `rand/loop/${count}/full` }), | ||
getLoopByID: id => callApi({ url: `loop/${id}/full` }), | ||
getLoopsByEpisode: id => callApi({ url: 'loop', data: { episode: id } }), | ||
getEpisodeByID: id => callApi({ url: `episode/${id}/full` }), | ||
getEpisodesBySeriesID: id => callApi({ url: 'episode', data: { series: id } }), | ||
getTagsByID: id => callApi({ url: 'tag', data: { loop: id } }), | ||
getSeriesByID: id => callApi({ url: `series/${id}` }), | ||
getSeriesByString: string => callApi({ url: 'search/series', data: { value: string } }), | ||
}; | ||
|
||
export default remote; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# ASSETS | ||
|
||
This directory contains your un-compiled assets such as LESS, SASS, or JavaScript. | ||
|
||
More information about the usage of this directory in the documentation: | ||
https://nuxtjs.org/guide/assets#webpacked | ||
|
||
**This directory is not required, you can delete it if you don't want to use it.** |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.