Browse Source

[FIX] 20200325 17:40

master
art.dambrine 5 years ago
parent
commit
3086661c12
  1. 2
      app.js
  2. 22
      docs/swagger.json
  3. 2
      routes.js
  4. 6
      welcome_page/index.html

2
app.js

@ -25,7 +25,7 @@ app.use(bodyParser.json());
// Route pour notre documentation
app.use('/docs', swaggerUi.serve, swaggerUi.setup(swaggerDocument)); // documentation à la racine
app.get('/', (req, res) => res.sendFile(path.join(__dirname + '/welcome_page/index.html'))); // route racine
app.get('/', (req, res) => res.sendFile(path.join(__dirname + '/welcome_page/index.html'))); // route welcome page
app.use("/api",routes) // route /api par défaut

22
docs/swagger.json

@ -21,6 +21,28 @@
],
"paths": {
"/etudiants": {
"get": {
"tags": [
"etudiant"
],
"summary": "Retourne la collection d'etudiants",
"description": "Retourne l'ensemble des etudiants",
"operationId": "getetudiants",
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "successful operation",
"schema": {
"$ref": "#/definitions/etudiant"
}
},
"404": {
"description": "etudiants not found"
}
}
},
"post": {
"tags": [
"etudiant"

2
routes.js

@ -5,7 +5,7 @@ const router = express.Router()
router.get('/', function (req, res) {
res.json({
status: "L'API fonctionne",
message: "Bienvenu sur l'API Etudiants"
message: "Bienvenue sur l'API Etudiants, retrouvez la doc à http://localhost:3000/docs/"
});
});

6
welcome_page/index.html

@ -92,7 +92,7 @@ header nav{
}
header nav ul li{
float: left;
/* float: left; */
display: inline-block;
}
@ -309,12 +309,12 @@ footer h1{
<a href="/api" class="button-1">Let's go !</a>
</section>
<footer>
<!-- <footer>
<div class="wrapper">
<h1>Fais avec amour<span class="green">.</span></h1>
<div class="copyright">Copyright © 2020. Tous droits réservés.</div>
</div>
</footer>
</footer> -->
</body>
</html>
Loading…
Cancel
Save