2 Commits

Author SHA1 Message Date
  Carlos Hernandez f3b526ab63 Find way to display articles content from API 2 years ago
  Carlos Hernandez 78de320aef Find way to display articles content from API 2 years ago
3 changed files with 3 additions and 19 deletions
  1. 2
    0
      Files-API/requirements.txt
  2. 1
    7
      app_template/www/articles.html
  3. 0
    12
      app_template/www/fetch_articles.js

+ 2
- 0
Files-API/requirements.txt View File

3
 decorator==5.1.0
3
 decorator==5.1.0
4
 flake8==4.0.1
4
 flake8==4.0.1
5
 Flask==2.0.2
5
 Flask==2.0.2
6
+Flask-Cors==3.0.10
6
 ipython==7.29.0
7
 ipython==7.29.0
7
 itsdangerous==2.0.1
8
 itsdangerous==2.0.1
8
 jedi==0.18.0
9
 jedi==0.18.0
19
 pycodestyle==2.8.0
20
 pycodestyle==2.8.0
20
 pyflakes==2.4.0
21
 pyflakes==2.4.0
21
 Pygments==2.10.0
22
 Pygments==2.10.0
23
+six==1.16.0
22
 traitlets==5.1.1
24
 traitlets==5.1.1
23
 wcwidth==0.2.5
25
 wcwidth==0.2.5
24
 Werkzeug==2.0.2
26
 Werkzeug==2.0.2

+ 1
- 7
app_template/www/articles.html View File

51
 
51
 
52
 		<!-- Custom JS -->
52
 		<!-- Custom JS -->
53
 		<script src="sortposts.js"></script>
53
 		<script src="sortposts.js"></script>
54
-		<script src="fetch_articles.js"></script>
55
 
54
 
56
 		<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
55
 		<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
57
 		<script>
56
 		<script>
110
 			<div class="container">
109
 			<div class="container">
111
 				<div class="row">
110
 				<div class="row">
112
 					<div class="col-md-12 section-heading text-center">
111
 					<div class="col-md-12 section-heading text-center">
113
-						<h2 class="to-animate">Home</h2>
114
-						<div class="row">
115
-							<div class="col-md-8 col-md-offset-2 subtext">
116
-								<h3 class="to-animate"> Hablando sobre lo que importa. </h3>
117
-							</div>
118
-						</div>
112
+						<h2 class="to-animate">Articles</h2>
119
 					</div>
113
 					</div>
120
 				</div>
114
 				</div>
121
 				<div class="row">
115
 				<div class="row">

+ 0
- 12
app_template/www/fetch_articles.js View File

1
-async function fetchArticle() {
2
-    let response = await fetch("http://localhost:5000/articles/article_1.txt");
3
-
4
-    console.log(response);
5
-    console.log(response.status);
6
-    console.log(response.statusText);
7
-
8
-    if (response.status == 200) {
9
-        let data = await response.text();
10
-        document.querySelector("#preview-text").textContent = data;
11
-    }
12
-}