Skip to content

Commit 84fe28d

Browse files
author
Stefan Wille
committed
configuration
1 parent 3c723df commit 84fe28d

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

src/App.tsx

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
1-
import React from 'react';
2-
import logo from './logo.svg';
3-
import './App.css';
1+
import "./App.css";
2+
import { Configuration, PostsApi } from "./generated-sources/openapi";
3+
4+
const configuration = new Configuration({
5+
basePath: window.location.origin,
6+
credentials: "same-origin",
7+
});
8+
9+
const postsApi = new PostsApi(configuration);
10+
11+
const App = () => {
12+
const onClick = () => {
13+
postsApi.getPosts();
14+
};
415

5-
function App() {
616
return (
717
<div className="App">
818
<header className="App-header">
9-
<img src={logo} className="App-logo" alt="logo" />
10-
<p>
11-
Edit <code>src/App.tsx</code> and save to reload.
12-
</p>
13-
<a
14-
className="App-link"
15-
href="https://reactjs.org"
16-
target="_blank"
17-
rel="noopener noreferrer"
18-
>
19-
Learn React
20-
</a>
19+
<button onClick={onClick}>Get Posts</button>
2120
</header>
2221
</div>
2322
);
24-
}
23+
};
2524

2625
export default App;

0 commit comments

Comments
 (0)