Commit 77c36482 authored by Andre Blanke's avatar Andre Blanke
Browse files

Serve static content via Spring instead of using httpd

parent 580dc46a
......@@ -24,13 +24,13 @@
│ │ └─ shortener.service # systemd service to start the URL shortener
│ ├─ frontend.yml
│ └─ worker.yml
├─ frontend/ # Angular frontend
│ └─ src/
│ └─ index.html
├─ shortener/ # Spring backend Maven project
│ ├─ .mvn/wrapper/ # Maven wrapper
│ ├─ src/
│ │ ├─ main/
│ │ │ ├─ frontend/ # Angular frontend
│ │ │ │ └─ src/
│ │ │ │ └─ index.html
│ │ │ ├─ kotlin/xyz/upbshrt/shortener/
│ │ │ │ ├─ controller/ # REST endpoints
│ │ │ │ │ └─ UrlShorteningController.kt # Responsible for the / and /{id} endpoints
......
......@@ -33,11 +33,6 @@
become_user: aur_builder
aur: name=yay-bin use=makepkg state=present
- name: Install Apache HTTP Server
package:
name: apache
state: present
- name: Install npm
package:
name: npm
......
This diff is collapsed.
# CockroachDB setup
```shell script
cockroach --http-addr localhost:8081
```
```postgresql
CREATE USER IF NOT EXISTS maxroach;
CREATE DATABASE roach_data;
GRANT ALL ON DATABASE roach_data TO maxroach;
```
......@@ -83,6 +83,7 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
......@@ -108,6 +109,68 @@
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.11.0</version>
<configuration>
<nodeVersion>v14.15.4</nodeVersion>
<npmVersion>6.14.11</npmVersion>
<workingDirectory>src/main/frontend</workingDirectory>
</configuration>
<executions>
<execution>
<id>install-node-and-npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<phase>generate-resources</phase>
</execution>
<execution>
<id>npm-install</id>
<goals>
<goal>npm</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>ng-build</id>
<goals>
<goal>npm</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<arguments>run ng build</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-frontend</id>
<goals>
<goal>copy-resources</goal>
</goals>
<phase>process-resources</phase>
<configuration>
<outputDirectory>${project.build.outputDirectory}/static</outputDirectory>
<resources>
<resource>
<directory>src/main/frontend/dist/frontend</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
......
......@@ -7,6 +7,9 @@
# Only exists if Bazel was run
/bazel-out
# frontend-maven-plugin
/node
# dependencies
/node_modules
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment