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
// index.mjs | |
import fs from "fs"; | |
import pg from "pg"; | |
import axios from "axios"; | |
import logger from "logger"; | |
import mon_premier_service from "services/mon_premier_service.mjs" | |
const datas = { "name": "world" }; | |
const adapters = { |
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
// services/mon_premier_service.mjs | |
export default function mon_premier_service(argDatas, argAdaptaters) { | |
argAdaptaters.lire_un_fichier(); | |
argAdaptaters.mettre_a_jour_la_base_de_données(); | |
argAdaptaters.appeller_un_service_post(); | |
argAdaptaters.logger.warn(); | |
return { "out": "hello " + argDatas.name } | |
} |
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
// services/mon_premier_service.mjs | |
import fs from "fs"; | |
import pg from "pg"; | |
import axios from "axios"; | |
import logger from "logger"; | |
export default function mon_premier_service(argDatas, argAdaptaters) { | |
fs.readFile(); // lire un fichier | |
pg.update(); // mettre à jour la base de données | |
axios.post(); // appeller un service post |
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
// index.mjs | |
import mon_premier_service from "services/mon_premier_service.mjs" | |
const datas = { "name": "world" }; | |
const adapters = {}; | |
const result = mon_premier_service(datas, adapters); |
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
// services/mon_premier_service.mjs | |
export default function mon_premier_service(argDatas, argAdaptaters) { | |
return { "out": "hello " + argDatas.name } | |
} |
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
extern crate iso639_2; | |
use iso639_2::Iso639_2; | |
pub fn main() { | |
println!("{:?}", Iso639_2::Eng); | |
assert!(Iso639_2::Fra != Iso639_2::Eng); | |
} |
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
extern crate iso639_1; | |
use iso639_1::{Iso639_1, get_enum, get_code_iso639_3}; | |
pub fn main() { | |
assert!(Iso639_1::Fr != Iso639_1::En); | |
assert!(get_enum("fr").unwrap() == Iso639_1::Fr); | |
assert!(get_code_iso639_3("fr").unwrap() == "fra"); | |
} |
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
extern crate iso639_1; | |
use iso639_1::{Iso639_1, get_enum, get_code_iso639_3}; | |
pub fn main() { | |
println!("{:?}", Iso639_1::En); | |
println!("{:?}", get_enum("it")); | |
println!("{:?}", get_code_iso639_3("fr")); | |
} |
NewerOlder