-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #119 from SocialGouv/fix-simplifier-dept
feat(demographie): ajout dom
- Loading branch information
Showing
3 changed files
with
65 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
id,codeRegion,code,nom | ||
102,COM,975,"Saint-Pierre-et-Miquelon" | ||
103,COM,977,"Saint-Barthélemy" | ||
104,COM,978,"Saint-Martin" | ||
105,COM,984,"Terres australes et antarctiques françaises" | ||
106,COM,986,"Wallis et Futuna" | ||
107,COM,987,"Polynésie française" | ||
108,COM,988,"Nouvelle-Calédonie" | ||
109,COM,989,"Île de Clipperton" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import path from "path" | ||
import { promises as fs } from "fs" | ||
|
||
export default async function staticDepartmentComData(_req, res) { | ||
//Find the absolute path of the csv directory | ||
const jsonDirectory = path.join(process.cwd(), "csv") | ||
|
||
//Read the csv data file data.csv | ||
const fileContents = await fs.readFile( | ||
jsonDirectory + "/departments-com.csv", | ||
"utf8" | ||
) | ||
console.log(fileContents) | ||
|
||
//Return the content of the data file in json format | ||
res.status(200).json(fileContents) | ||
} |
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