Skip to content

Commit

Permalink
Implement the ability to GET from localhost:7070 to read files and di…
Browse files Browse the repository at this point in the history
…rectories
  • Loading branch information
StarLederer committed Oct 30, 2021
1 parent 00c23f5 commit 43d1ecf
Show file tree
Hide file tree
Showing 5 changed files with 651 additions and 10 deletions.
27 changes: 27 additions & 0 deletions api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const express = require("express");

const app = express();

// app.use(express.json());
// app.use(cors());

//
//
// Requests

// GET request
app.get("/*", async (req, res) => {
console.log("11111111");
res.status(200).send({
type: "file",
test: 1,
});
});

//
//
// Start the app

app.listen(7070, () => {
console.log("fs server has started on port 6666");
});
24 changes: 19 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@
"name": "vite-plugin-fs",
"version": "0.1.0",
"description": "Interact with fs by fetching requests from a local API",
"main": "dist/index.js",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js"
}
},
"scripts": {
"dev": "pnpm run build:ci -- --sourcemap --watch src",
"build:ci": "rimraf dist && tsup-node src/index.ts --format esm,cjs --no-splitting --target node14",
"build": "pnpm run build:ci -- --dts --sourcemap"
"dev": "npm run build -- --watch",
"build": "tsup src/index.ts --dts --format cjs,esm"
},
"engines": {
"node": ">=12.0.0"
Expand Down Expand Up @@ -37,14 +43,22 @@
"vite": "^2.5.10"
},
"devDependencies": {
"@types/cors": "^2.8.12",
"@types/express": "^4.17.13",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"eslint": "7.32.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-config-airbnb-typescript": "^14.0.1",
"eslint-plugin-import": "^2.25.2",
"rimraf": "^3.0.2",
"rollup": "^2.58.3",
"tsup": "^5.5.0",
"typescript": "^4.4.4"
"typescript": "^4.4.4",
"vite": "^2.6.13"
},
"dependencies": {
"cors": "^2.8.5",
"express": "^4.17.1"
}
}
Loading

0 comments on commit 43d1ecf

Please sign in to comment.