[ADD]Node Server Static
This commit is contained in:
parent
6752558cfe
commit
2513e0d8a6
15
package.json
15
package.json
@ -1,22 +1,25 @@
|
||||
{
|
||||
"name": "odoodockersshcmd",
|
||||
"name": "odoodockersshadmin",
|
||||
"version": "0.1.0",
|
||||
"description": "",
|
||||
"scripts": {
|
||||
"dev": "webpack -w",
|
||||
"prod": "webpack -p"
|
||||
"prod": "webpack -p",
|
||||
"serve": "node server"
|
||||
},
|
||||
"author": "Fabien BOURGEOIS",
|
||||
"license": "MPL",
|
||||
"homepage": "",
|
||||
"homepage": "https://git.yaltik.net/Yaltik/odsa",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://git.yaltik.net/Yaltik/odoo-docker-ssh-cmd.git"
|
||||
"url": "https://git.yaltik.net/Yaltik/odsa.git"
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"solid-js": "~0.5.0",
|
||||
"babel-plugin-jsx-dom-expressions": "~0.7.0"
|
||||
"babel-plugin-jsx-dom-expressions": "~0.7.0",
|
||||
"polka": "^0.5.2",
|
||||
"sirv": "^0.4.0",
|
||||
"solid-js": "~0.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.1.0",
|
||||
|
17
server.js
Normal file
17
server.js
Normal file
@ -0,0 +1,17 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
const http = require('http');
|
||||
const { join } = require('path');
|
||||
const polka = require('polka');
|
||||
const sirv = require('sirv');
|
||||
|
||||
const { PORT=3000 } = process.env;
|
||||
const files = sirv('dist');
|
||||
const server = http.createServer();
|
||||
|
||||
polka({ server }).use(files).listen(PORT, err => {
|
||||
if (err) throw err;
|
||||
console.log(`> Running on localhost:${PORT}`);
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user