Code Monkey home page Code Monkey logo

feserve's Introduction

Feserve

Mentioned in Awesome Fiber Go Report Card GitHub Workflow Status Release FOSSA Status

English | Indonesia

Feserve is a lightweight application created to make it easier for Frontend Developers to deploy their applications, without having to use Nginx, Node.js or the like which take up a lot of storage space.

Feature

  • Serve static files
  • Custom url path to file
  • Load balancer (HTTP)
  • Generate SSL certificate and auto renew (Let's Encrypt)

Installation

Binary File

Here I use linux with amd64 architecture as an example. Please adjust to your OS and Architecture here. Then download, verify the signature, and extract it like the following example.

wget https://github.com/ryanbekhen/feserve/releases/download/v0.1.0/feserve_0.1.0_linux_amd64.zip
wget https://github.com/ryanbekhen/feserve/releases/download/v0.1.0/checksums.txt
unzip feserve_0.1.0_linux_amd64.zip 
sha256sum --ignore-missing -c checksums.txt

After running the above command, move the binary file to /usr/local/bin with the following command.

sudo mv feserve /usr/local/bin

# permission for 80/443
sudo setcap 'cap_net_bind_service=+ep' ./usr/local/bin

Via go install

go install github.com/ryanbekhen/feserve

Note: go version go1.19.5 or later

Setup

Directory Structure

root-directory/
|- build/
|- app.yaml

Configuration app.yaml

version: 1
port: 8000
publicDir: build

With the above configuration, feserve will run on port 8000 and public/ as its public directory. To see more details here.

Usage

Local

To run it locally, just run feserve in your root directory with the following command.

feserve

Then open a browser at http://localhost:8000.

Docker

Before running the command below, first create the app.yaml config file.

docker run --name feserve -d \
  -p 80:80 \
  -p 443:443 \
  -v $(pwd)/certs:/certs \
  -v $(pwd)/app.yaml:/app.yaml \
  ghcr.io/ryanbekhen/feserve:latest

Dockerfile

To run it within docker, create a file Dockerfile like the following example.

# application build
FROM node:16-alpine As build
WORKDIR /app
COPY . .
RUN npm ci 
RUN npm run build
ENV NODE_ENV production

# application serve
FROM ghcr.io/ryanbekhen/feserve:latest
WORKDIR /app
COPY app.yaml .
COPY --from=build /app/build /app/build
EXPOSE 8000
ENTRYPOINT ["feserve"]

It can also be done in the following way if we have built it first.

FROM ghcr.io/ryanbekhen/feserve:latest
WORKDIR /app
COPY app.yaml .
COPY build ./build
EXPOSE 8000
ENTRYPOINT ["feserve"]

To try to run it simply with the following command.

docker build -t image-name .
docker run --rm -p 8000:8000 image-name

Then open a browser at http://localhost:8000.

Security

If you discover a security vulnerability within Feserve, please send an e-mail to [email protected].

License

This program is free software. You can redistribute it and/or modify it under the terms of the MIT license. Feserve and any contributions are copyright © by Achmad Irianto Eka Putra 2023.

FOSSA Status

feserve's People

Contributors

deepsource-autofix[bot] avatar deepsourcebot avatar dependabot[bot] avatar fossabot avatar irsanmansyur avatar rikinofianto avatar ryanbekhen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

feserve's Issues

(GO-W1029) Usage of both value and pointer receivers

Description

(Go's FAQ)[https://go.dev/doc/faq#methods_on_values_or_pointers] recommends that method receivers should be consistent. If some of the methods of the type must have pointer receivers, the rest should too, so the method set is consistent regardless of how the type is used. This is because value and pointer receivers have different method sets.

Occurrences

There are 3 occurrences of this issue in the repository.

See all occurrences on DeepSource → deepsource.io/gh/ryanbekhen/feserve/issue/GO-W1029/occurrences/

Different Time Zone

Screen Shot 2023-01-19 at 19 32 24
Om time zone saat starting server berbeda dengan log http, sedangkan kita sudah set time zone-nya di file app.yaml

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.