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
const express = require("express"); | |
const app = express(); | |
const port = 3000; | |
app.get("/", (req, res) => { | |
res.send("Hello World!"); | |
}); | |
app.listen(port, () => { | |
console.log(`Example app listening at http://localhost:${port}`); |
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
import chalk from "chalk"; | |
console.log(chalk.blue("Hello") + " World" + chalk.red("!")); | |
console.log(chalk.black.bgWhite.bold("Hello world!")); |
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
<jboss-web xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns="http://www.jboss.com/xml/ns/javaee" | |
xsi:schemaLocation=" | |
http://www.jboss.com/xml/ns/javaee | |
http://www.jboss.org/j2ee/schema/jboss-web_5_1.xsd"> | |
<context-root>/</context-root> | |
</jboss-web> |
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
<?xml version="1.0" encoding="UTF-8" ?> | |
<datasources> | |
<datasource jndi-name="java:/jeeds" pool-name="ExampleDS" enabled="true" | |
use-java-context="true" | |
statistics-enabled="true"> | |
<connection-url>jdbc:h2:~/test</connection-url> | |
<driver>h2</driver> | |
<security> | |
<user-name>sa</user-name> | |
<password>sa</password> |
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
<module xmlns="urn:jboss:module:1.3" name="com.mariadb"> | |
<resources> | |
<resource-root path="mariadb-java-client-2.7.1.jar"/> | |
</resources> | |
<dependencies> | |
<module name="javax.api"/> | |
<module name="javax.transaction.api"/> | |
</dependencies> | |
</module> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<persistence version="2.2" | |
xmlns="http://xmlns.jcp.org/xml/ns/persistence" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd"> | |
<persistence-unit name="prod"> | |
<properties> | |
<property name="hibernate.connection.driver_class" value="org.mariadb.jdbc.Driver"/> | |
<property name="hibernate.dialect" value="org.hibernate.dialect.MariaDBDialect" /> | |
<property name="hibernate.connection.url" value="jdbc:mariadb://localhost:3306/coursjee8" /> |
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
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.2" | |
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd"> | |
<persistence-unit name="my-persistence-unit"> | |
<properties> | |
<!-- database connection --> | |
<property name="javax.persistence.jdbc.driver" value="org.postgresql.Driver" /> | |
<property name="javax.persistence.jdbc.url" value="jdbc:postgresql://localhost:5432/jpaForBeginners" /> | |
<property name="javax.persistence.jdbc.user" value="postgres" /> | |
<property name="javax.persistence.jdbc.password" value="postgres" /> |
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
import javax.ejb.*; | |
import javax.inject.Inject; | |
import java.util.List; | |
@Stateless | |
@TransactionManagement(TransactionManagementType.BEAN) | |
public class CrewBean { | |
@Inject | |
private CrewMemberDao crewMemberDao; |
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
import javax.inject.Inject; | |
import javax.ws.rs.*; | |
import javax.ws.rs.core.MediaType; | |
import javax.ws.rs.core.Response; | |
@Path("amangousse") | |
public class AmongousseResource { | |
@Inject | |
private CrewBean crewBean; |
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
package fr.cours.jee.amangousse; | |
import javax.ws.rs.*; | |
import javax.ws.rs.core.MediaType; | |
import javax.ws.rs.core.Response; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.stream.Collectors; | |
@Path("amangousse") |